jsmreese / moment-duration-format

Format function plugin for the Moment Duration object.
MIT License
969 stars 120 forks source link

Use comma separators (locale-formatted numbers) #70

Closed jpuffer closed 7 years ago

jpuffer commented 7 years ago

It would be great to allow an option to format numbers in a locale-sensitive way as provided by Number.prototype.toLocaleString(), so numbers would have comma separators where appropriate.

Current Behavior: moment.duration(1000, 'days').format("D[ days], H[ hours], m[ minutes]") -> "1000 days, 0 hours, 0 minutes"

Desired Behavior: moment.duration(1000, 'days').format("D[ days], H[ hours], m[ minutes]") -> "1,000 days, 0 hours, 0 minutes"

(or if https://github.com/jsmreese/moment-duration-format/issues/25 ever gets addressed, we could simply get the output: "1,000 days")

deanMike commented 7 years ago

+1