Test name | Executions per second |
---|---|
toFixed(4) someFloat.toFixed(4); someFloat.t | 2351429.0 Ops/sec |
toPrecision(4).toString() | 2646585.8 Ops/sec |
(Math.round(*10000)/10000).toString() | 2845368.8 Ops/sec |
Math.floor fast | 8042788.5 Ops/sec |
Math.trunc | 2714210.2 Ops/sec |