DEV Community

Discussion on: .toLocaleString, one of the most underrated JavaScript features

Collapse
 
lioness100 profile image
Lioness100

What are the differences between Number#toString() and Intl.NumberFormat?

Collapse
 
siddharthshyniben profile image
Siddharth

.toString doesn't provide the features of Intl. It only supports stringifying to a base.

Collapse
 
lioness100 profile image
Lioness100 • Edited

Sorry, I meant .toLocaleString()

Thread Thread
 
siddharthshyniben profile image
Siddharth

The features are the same, except Intl is faster when you need to run the stringification multiple times

Thread Thread
 
lioness100 profile image
Lioness100

Ah, thanks!