pastorandy
IS-IT--Management
I have the following that calculates and displays the result in an html input form field called payment_amount
What I can't seem to do is to format the output to only 2 decimal places. Any advice?
Code:
<input type="button" class="input-calc" name="plus2" value="Calculate Deposit"
onClick="document.calc2.payment_amount.value =
parseFloat((document.calc2.total_cost.value) - parseFloat(document.calc2.discount_given.value))* 0.3">
What I can't seem to do is to format the output to only 2 decimal places. Any advice?