Answers for "round number to specific steps in js"

2

Javascript round number to nearest 5

function round5(x)
{
    return Math.ceil(x/5)*5;
}
Posted by: Guest on November-04-2020
0

js number round to each 15

Math.ceil(n / 15) * 15
// 3 -> 15, 22 -> 30 etc.
Posted by: Guest on January-12-2021

Code answers related to "round number to specific steps in js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language