Script Preparation code:
AخA
 
var someFloat = 0.123456789;
Tests:
  • toFixed(2)

     
    someFloat.toFixed(2)
  • 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(2)
    Round

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0
Firefox 110 on Windows
View result in a separate tab
Test name Executions per second
toFixed(2) 27772852.0 Ops/sec
Round 1842555392.0 Ops/sec