3 ms·
Spaces is actually an international standard, as part of SI, for scientific writing. If a numerical value has more than 4 digits on either side of the decimal m
by tzs 3y ago
Spaces is actually an international standard, as part of SI, for scientific writing. If a numerical value has more than 4 digits on either side of the decimal marker, make groups of three using a thin fixed space.
For the decimal marker "." and "," are both acceptable. Use whichever is appropriate for your country or for where you readers are or whatever.
Unicode U+2009 (thin space) or U+202F (narrow no-break space) are good for this, but unfortunately neither of them are among the Unicode that works on HN. HN converts them on input to a normal space.
E.g., 12 345 (space), 12 345 (U+2009), and 12 345 (U+202F) are all the same on HN.
That wasn't always the case. I'm not sure when they started filtering these out on input, but 6 years ago I posted a comment where I pasted in some text demonstrating various Unicode spaces [1], and that works so the change was sometime in the last 6 years.
Note: it only works for me in Chrome. In Firefox and Safari the browser changes them all to normal space. I don't know if that is just something peculiar to my Firefox and Safari installations or if Chrome just does Unicode better than they do.
[1] https://news.ycombinator.com/item?id=16194485 https://news.ycombinator.com/item?id=16194485