Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.113 Safari/537.36
Chrome 94
Windows
Desktop
2 years ago
Test name Executions per second
toLocaleString 23925.5 Ops/sec
Intl.NumberFormat 22550.8 Ops/sec
string split & reduce 829920.6 Ops/sec
toFixed 3213086.2 Ops/sec
bignumber 297915.6 Ops/sec
numberWithCommas 928390.2 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • toLocaleString

  • Intl.NumberFormat

  • string split & reduce

  • toFixed

  • bignumber

  • numberWithCommas