JSFiddle - React, Tailwind, and code Playground
by neonDog
JavaScript
function round5(x) {
return Math.round(x / 5) * 5;
}
const roundHalf = function(n) {
return (Math.round(n*2)/2);
};
alert(roundHalf(3.76));
by neonDog
function round5(x) {
return Math.round(x / 5) * 5;
}
const roundHalf = function(n) {
return (Math.round(n*2)/2);
};
alert(roundHalf(3.76));