Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 15_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/96.0.4664.53 Mobile/15E148 Safari/604.1
Chrome Mobile iOS 96
iOS 15.1
Mobile
3 years ago
Test name Executions per second
toFixed(4) 7397187.5 Ops/sec
toPrecision(4).toString() 6894249.5 Ops/sec
(Math.round(*10000)/10000).toString() 7024672.5 Ops/sec
Script Preparation code:
Tests:
  • toFixed(4)

  • toPrecision(4).toString()

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