Hi all, I have been tasked with creating a custom "calculator" for a client that uses a specific equation. The client inputs data into two Input Text fields and the result shows up in a dynamic text field. Is there any way I can limit the number of decimal places to two? Here is my code (which works, except for the decimal issue):
one = Number(number_one);
two = Number(number_two);
result_1 = ((one / 4) * (65 / (1 - 0.25))) + ((two / 0.5) * (65 / (1 - 0.25)));
Thanks in advance!!!!
What will often be done is the result is first multiplied by 100, then rounded to an integer, then divided by 100. So picking up from your last line where you calcvulate the result_1 value...
result_1 = Math.round(result_1*100)/100;
Yay!!!!! Thank you so much!