Hi guys,
I got my other problem to work, the calculator problem.
This time I want to know is there a way to have only 2 decimal places? I'm calculating costs and when I multiply 2 values together in a couple of my functions, the answers result in many digits after the decimal. So is there a method that can round to only 2 decimal places?
I don't think Math.round() will do it, since that only rounds to integers right?
One of my functions is:
function lamp_savings () {
document.cost.save_lamps.value = ((document.cost.ann_cost2.value) * (document.cost.watt_save2.value))
document.cost.save_lamps.blur()
}
Thanks,
Arif
I got my other problem to work, the calculator problem.
This time I want to know is there a way to have only 2 decimal places? I'm calculating costs and when I multiply 2 values together in a couple of my functions, the answers result in many digits after the decimal. So is there a method that can round to only 2 decimal places?
I don't think Math.round() will do it, since that only rounds to integers right?
One of my functions is:
function lamp_savings () {
document.cost.save_lamps.value = ((document.cost.ann_cost2.value) * (document.cost.watt_save2.value))
document.cost.save_lamps.blur()
}
Thanks,
Arif