I am trying to round up the results for this block of JS code. I tried Math.round, and it did not work, or may be I don't know where and how to use this. Can you please advise me on how to round up the result for "hoursOfVacationPerMinute".
Currently if I run the code, I get 0.0009132420091324201 for hoursOfVacationPerMinute
Thanks in advance.
hoursOfVacationPerMinute = totalVacationHours / dividend;
document.write("Hours of vacation per Minute: " +hoursOfVacationPerMinute+ "</br>");
Math.round() works to round up/down to nearest integer (aka whole number). You can use the toFixed() method to specify rounding to a decimal place...
This post has been edited by Martyr2: 25 September 2012 - 11:22 AM