Test name | Executions per second |
---|---|
toFixed | 3988963.2 Ops/sec |
toPrecision | 4250638.0 Ops/sec |
rounding | 3567124.0 Ops/sec |
var someFloat = 0.123456789;
someFloat.toFixed(1);
someFloat.toPrecision(1).toString();
(Math.round(someFloat*10)/10).toString();