Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Mobile/15E148 Safari/604.1
Mobile Safari 12
iOS 12.4.5
Mobile
4 years ago
Test name Executions per second
toFixed(4) 1679291.5 Ops/sec
toPrecision(4).toString() 1560110.9 Ops/sec
(Math.round(*10000)/10000).toString() 1590390.5 Ops/sec
Math.floor fast 3725935.0 Ops/sec
Script Preparation code:
Tests:
  • toFixed(4)

  • toPrecision(4).toString()

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

  • Math.floor fast


;