adamwdraper / Numeral-js

A javascript library for formatting and manipulating numbers.
http://numeraljs.com
MIT License
9.65k stars 926 forks source link

Space-ish thousand separators should not be breakable #695

Open mminot-yseop opened 4 years ago

mminot-yseop commented 4 years ago

In the locales/ directory, if I run…

$ grep thousand ./*.js | grep "'[   ]'"

… where, in the [], we have:

I get 19 results, meaning that, currently, 19 locales use spaces as thousand separators.

Open this to get the list ``` bg.js cs.js de-ch.js de.js en-za.js et.js fi.js fr-ca.js fr.js hu.js lv.js nl-be.js no.js pl.js pt-pt.js ru.js ru-ua.js sk.js uk-ua.js ```

What bothers me is that if you remove the “basic”, breakable space from this grep, you suddenly get no result at all. In other words, all those locales generate numbers that are prone to get split by linebreaks.

I’m no expert and I can only vouch for the French locale, but I doubt there are many languages that are fine with getting their numbers split like this.

Regarding the “U+202F vs. U+00A0” matter, I personnaly love U+202F (narrow, and non-dilatable in most browsers, I think, while U+00A0 tends to spread like crazy and makes numbers look weird).

ibiza240 commented 2 years ago

+1