toFixed().replace() vs Number().toFixed().replace() vs Intl.NumberFormat() vs text Intl.NumberFormat()Fastest: toFixed().replace() (133.3x faster)
8,638,186 ops/sec
6,541,954 ops/sec
64,796 ops/sec
64,783 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| toFixed().replace() | |
| Number().toFixed().replace() | |
| Intl.NumberFormat() | |
| text Intl.NumberFormat() |
| 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 |