Test case name | Result |
---|---|
toFixed(2) | |
toPrecision(2).toString() | |
(Math.round(*100)/100).toString() | |
(Math.round(*100) * 0.01).toString() | |
customRound(*100) * 0.01.toString() |
Test name | Executions per second |
---|---|
toFixed(2) | 3158512.8 Ops/sec |
toPrecision(2).toString() | 4505558.5 Ops/sec |
(Math.round(*100)/100).toString() | 5027852.0 Ops/sec |
(Math.round(*100) * 0.01).toString() | 5005704.5 Ops/sec |
customRound(*100) * 0.01.toString() | 6968986.0 Ops/sec |