I have the following code which works fine but it's giving me the result either without decimal places or if it is with a decimal place then it is showing up only character. For instance, 1250.5 instead of 1250.50.
Code is as follows. Any help would be greatly appreciated.
var f=document.forms[0];
f.Total.value=0;
f.Balance.value=0;
for(x=0;x<3;x++)
{
f.Total.value=parseFloat(f.TotalCharges(x).value,10)+parseFloat(f.Total.value);
f.Balance.value=parseFloat(f.BalanceDue(x).value,10)+parseFloat(f.Balance.value);
}
</script>
Code is as follows. Any help would be greatly appreciated.
var f=document.forms[0];
f.Total.value=0;
f.Balance.value=0;
for(x=0;x<3;x++)
{
f.Total.value=parseFloat(f.TotalCharges(x).value,10)+parseFloat(f.Total.value);
f.Balance.value=parseFloat(f.BalanceDue(x).value,10)+parseFloat(f.Balance.value);
}
</script>