Test case name | Result |
---|---|
someFloat.toFixed(2); | |
Math.round(someFloat * 100) / 100; | |
((someFloat * 100) | 0 ) / 100; |
Test name | Executions per second |
---|---|
someFloat.toFixed(2); | 4289698.5 Ops/sec |
Math.round(someFloat * 100) / 100; | 3824472.5 Ops/sec |
((someFloat * 100) | 0 ) / 100; | 11622679.0 Ops/sec |