Script Preparation code:
AخA
 
var someFloat = '0.123456789';
Tests:
  • toFixed

     
    parseFloat(parseFloat(someFloat).toFixed(2));
  • Math.round

    x
     
    Math.round(someFloat * 100) / 100;
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    toFixed
    Math.round

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one month ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:135.0) Gecko/20100101 Firefox/135.0
Firefox 135 on Windows
View result in a separate tab
Test name Executions per second
toFixed 8159346.0 Ops/sec
Math.round 1185677056.0 Ops/sec