Alternative for Math.round()

In JavaScript when value is 4.3, i want it to round off to 4 and if value is 4.5 or above it rounds off to 5. I want all this without using Math.round().

Answer

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));