Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
toLocaleString vs custom thousands seperator
(version: 0)
Comparing performance of:
toLocaleString vs custom thousands seperator
Created:
5 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var number = 1234567; var addThousandsSeperators = (value) => { if (value.length <= 3) return value; return Array.from(value).reduce((acc, x, i, a) => ( (a.length - i) % 3 === 0 && i ? `${acc},${x}` : `${acc}${x}` ), ''); };
Tests:
toLocaleString
number.toLocaleString();
custom thousands seperator
addThousandsSeperators(number);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
toLocaleString
custom thousands seperator
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
toLocaleString vs custom thousands seperator2
toLocaleString vs custom thousands seperator4
Number & toLocaleString vs + & toLocaleString vs custom thousands seperator
toLocaleString explicit locale vs toLocaleString vs custom thousands seperator
Comments
Confirm delete:
Do you really want to delete benchmark?