sindresorhus/round-to
The issue has been closed
Performance of roundTo.down #12
edolganov posted onGitHub
Hi! I checked roundTo.down method and the alternative one:
var delta = Math.pow(10, precision)
var result = Math.floor(input * delta) / delta;
Example:
>> Math.floor(110.30115528834406 * 100000000) / 100000000
<< 110.30115528
I used both implementations 1,000,000 times. Check out results: :-1: roundTo.down - 1.396 sec :+1: alternative - 0.017sec
Hope it will help you to improve a roundTo.down performance :smiley: