Script Preparation code:
Tests:
  • someFloat.toFixed(4);

  • someFloat.toPrecision(4).toString();

  • (Math.round(someFloat*10000)/10000).toString();

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    someFloat.toFixed(4);
    someFloat.toPrecision(4).toString();
    (Math.round(someFloat*10000)/10000).toString();

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 OPR/93.0.0.0
Opera 93 on Windows
View result in a separate tab
Test name Executions per second
someFloat.toFixed(4); 6070845.5 Ops/sec
someFloat.toPrecision(4).toString(); 6761235.5 Ops/sec
(Math.round(someFloat*10000)/10000).toString(); 6511857.0 Ops/sec


;