I want to convert all numbers to the nearest .25
So...
5 becomes 5.00 2.25 becomes 2.25 4 becomes 4.00 3.5 becomes 3.50
Thanks
Here’s an implementation of what rslite said:
var number = 5.12345; number = (Math.round(number * 4) / 4).toFixed(2);
2.1m questions
2.1m answers
60 comments
57.0k users