I have a web site which calculates a discount based on selection of a checkbox, I would like the output into “total” to be rounded to zero (0) decimal places. I have tried a couple of thing and they fail to write to “total”.
Thank you for the help in advance,
Brian
clear_form is clearing form of any previous entries
discountValue is a var dependent on if checkbox is checked or unchecked
k is var which is the before discount price
“discount” is input type=“text”
“total” is input type=“text”
fillInButton() is a function to send the total to paypal
function discountAmount()
{
clear_form_elements(document.getElementById(“section_4”));
number2 = k * discountValue;
document.getElementById(“discount”).value = “$” + “-” + number2;
p = k - number2
document.getElementById(“total”).value = “$” + p;
fillInButton();
}