If the following function performs calculation
<script type="text/javascript">
function updatesum() {
document.PaymentForm.newbalance.value = (document.PaymentForm.balance.value -0) - (document.PaymentForm.paymentamount.value -0);
}
</script>
How do I incorporate above function and the one below into one to thus do the calculation and round the number?
<script type = "text/javascript">
function roundNumber(num, dec) {
var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);
return result;
}
alert (roundNumber (12345.6789, 2));
</script>
Any thoughts!
Mossa