in javascript, lets say I got a random number 136, i'd like it to convert it automatically to 140 or if I got 124 to 120 etc or 24 to 20 etc..
Divide by 10 and round it, then multiply by 10.
var x = 136;
console.log(Math.round(x / 10) * 10);
I would just do this: ( Math.round(YourNumber/10) ) * 10
©2020 All rights reserved.