You can do this
function RoundNum(number){
var c = number % 1;
return number-c+(c/1+1.5>>1)*1
}
console.log(RoundNum(2.456));
console.log(RoundNum(102.6));
console.log(RoundNum(203.515));
1
solved Alternative for Math.round()
You can do this
function RoundNum(number){
var c = number % 1;
return number-c+(c/1+1.5>>1)*1
}
console.log(RoundNum(2.456));
console.log(RoundNum(102.6));
console.log(RoundNum(203.515));
1
solved Alternative for Math.round()