Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0
Firefox 127
Windows
Desktop
4 months ago
Test name Executions per second
toFixed(6) 23949510.0 Ops/sec
toPrecision(6).toString() 18116802.0 Ops/sec
(Math.round(*1000000)/1000000) 1782905216.0 Ops/sec
Math.floor( * 1000000) 1775076096.0 Ops/sec
Script Preparation code:
Tests:
  • toFixed(6)

  • toPrecision(6).toString()

  • (Math.round(*1000000)/1000000)

  • Math.floor( * 1000000)