im experiencing a really weird problem. Im trying to multiply 2 decimal values, but the result i get is an integer/rounded number. If i add decimals (for example toFixed(2), it just adds some zeroes).
Here is the script:
$(document).ready(function () {
$('.txtQuantity, .txtRate').change(function () {
var txtQuantity = $('.txtQuantity').val();
var txtRate = $('.txtRate').val();
var total = parseFloat(txtQuantity) * parseFloat(txtRate);
$('.txtTotal').val(total);
});
});
and here is the html:
<table>
<tr>
<td><input type="text" class="txtQuantity" /></td>
<td><input type="text" value="12,3" class="txtRate" /></td>
<td><input type="text" disabled="disabled" class="aspNetDisabled txtTotal" /></td>
</tr>
</table>
here is a fiddle
What am i missing? it must be something trivial.
Thanks