Test case name | Result |
---|---|
+someFloat.toFixed(4); | |
(Math.round(someFloat*10000)/10000); | |
~~(someFloat * 10000) / 10000; |
Test name | Executions per second |
---|---|
+someFloat.toFixed(4); | 14901734.0 Ops/sec |
(Math.round(someFloat*10000)/10000); | 1662973440.0 Ops/sec |
~~(someFloat * 10000) / 10000; | 1559779072.0 Ops/sec |