Test name | Executions per second |
---|---|
toFixed(4) someFloat.toFixed(4); someFloat.t | 2837031.0 Ops/sec |
toPrecision(4).toString() | 3362133.0 Ops/sec |
(Math.round(*10000)/10000).toString() | 3074717.0 Ops/sec |
Math.floor fast | 9713553.0 Ops/sec |
Math.trunc | 3117407.0 Ops/sec |
numeraljs | 225310.7 Ops/sec |