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