Round a number to few decimal places:
To round a number to few decimal places use the following samples
Round to one decimal place
Math.round(35.2499 * 10) / 10 // returns 35.2
Round to two decimal place
Math.round(35.2499 * 100) / 100 // returns 35.25
Round to three decimal place
Math.round(35.2499 * 1000) / 1000 // returns 35.25
Round a number to the nearest multiple of an integer:
To round a number to nearest multiple of an integer use the following samples
Round a number to nearest multiple of 5
Math.round(35.2499 / 5) * 5 // returns 35
Round a number to nearest multiple of 10
Math.round(35.2499 / 10) * 10 // returns 40