I use the following script to calculate the total amount due based on the amount ("invoice") entered in the form ("pay"). All works as needed, except that I need to be able to limit the results to two decimal places, preferably rounded as needed. What am I missing?
Thank you,
Meghan
Thank you,
Meghan
Code:
<script language="JavaScript">
function doTotals()
{
var x = document.forms['pay'].elements['invoice'].value;
var z = ((x*1.029)+(0.3))
document.forms['pay'].elements['amount'].value = z;
}
</script>