Test case name | Result |
---|---|
someFloat.toPrecision(1) | |
Math.round(someFloat) | |
someFloat.toFixed(0); |
Test name | Executions per second |
---|---|
someFloat.toPrecision(1) | 20714548.0 Ops/sec |
Math.round(someFloat) | 1543128704.0 Ops/sec |
someFloat.toFixed(0); | 22904452.0 Ops/sec |