Script Preparation code:
Tests:

Historical Performance Data aggregated from 17 community runs

Desktop Results:
Chrome 17 runs
toFixed().replace()
8.6M/s
Number().toFixed().replace()
6.5M/s
text Intl.NumberFormat()
65K/s
Intl.NumberFormat()
65K/s

Fastest: toFixed().replace() (133.3x faster)

View exact numbers
  • toFixed().replace(): 8,638,186 ops/sec
  • Number().toFixed().replace(): 6,541,954 ops/sec
  • text Intl.NumberFormat(): 64,796 ops/sec
  • Intl.NumberFormat(): 64,783 ops/sec

Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    toFixed().replace()
    Number().toFixed().replace()
    Intl.NumberFormat()
    text Intl.NumberFormat()

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36 Edg/137.0.0.0
Chrome 137 on Windows
View result in a separate tab
toFixed().replace()
12.1M/s
Number().toFixed().replace()
11.9M/s
Intl.NumberFormat()
62K/s
text Intl.NumberFormat()
61K/s
View exact numbers
Test name Executions per second
toFixed().replace() 12,145,684 Ops/sec
Number().toFixed().replace() 11,914,457 Ops/sec
Intl.NumberFormat() 61,821 Ops/sec
text Intl.NumberFormat() 60,965 Ops/sec