Test name | Executions per second |
---|---|
toFixed(4) someFloat.toFixed(4); someFloat.t | 2953747.0 Ops/sec |
toPrecision(4).toString() | 3916936.5 Ops/sec |
(Math.round(*10000)/10000).toString() | 5405425.0 Ops/sec |
Math.floor fast | 15339768.0 Ops/sec |
Math.trunc | 5403480.5 Ops/sec |