How to round a number down to hundreds?
For example, if you have a value of 131, how do you round it to 100?
Or is there a value of 7798, how can I round it to 7700?
There are likely cleaner solutions out there that you can copy/ paste from stack overflow but will likely all revolve around the modulus operator (%):
131 % 100 = 31 (And then 131 - 31 = 100)
231 % 100 = 31(And then 231 - 31 = 200)
Hope this helps! If you do find a working snippet, would be awesome if you could post it here for other community members.
If you always round down then I guess this would work:
Math.floor(731 / 100) * 100 // 700 Math.floor(7798 / 100) * 7700 // 7700