Live data from Hacker News

Commas in big numbers everywhere: An OpenType adventure

blog.janestreet.com

41–43 of 43 posts

Re: Commas in big numbers everywhere: An OpenType adventure

#41

AFAIK general style guides don't recommend using thousand separators in numbers below 10000, so "variable #1,234" is not quite good, it should've been simply "variable #1234". "Variable 12,345" would've probably been OK, but then there's another semantic issue: thousand separators are only used in numbers that mean quantities, not identifiers. Long numeric identifiers like phone number or SSN are usually separated di…

Not touching 4 digit numbers is a good variant idea, I might do that, it would only be a one line of code change.

I also still think an alternative world where we decided to use font shaping for digit grouping would work out better, it would just maybe have different conventions. Numbers that you manually separated wouldn't be touched anyways unless you use any group longer than say 4 digits.

For contexts with long identifiers that don't represent quantities like database IDs there could be a stylistic convention of prefixing them with a @ or something instead of a manual stylistic convention for quantities. Then maybe your font could do something cool to make it easier to tell when two big ten digit random numbers in a column are the same, like a pattern of underscores based on hashing. Also having digit grouping in your meaningless IDs is way less of a problem than not having digit grouping in your quantities.

Re: Commas in big numbers everywhere: An OpenType adventure

#42
post #22

Could this be an potential avenue for some sort of exploit? I had no idea that you could "execute" logic via fonts.

Definitely. Project Zero had a multi-part series on this subject: https://googleprojectzero.blogspot.com/2015/07/one-font-vuln...

Re: Commas in big numbers everywhere: An OpenType adventure

#43
post #31

Earlier quoted context omitted.

Also, this is locale specific. Here in Germany we use dots instead of commas for that.

Not just Germany. Comma vs dot is just a big mess with some countries using both[1]. Even in Germany, which is decimal comma country, the dot is ubiquitous in science and technology publications. Best thing is to stick with dot and us neither comma nor dot as thousands separator but a thin, fixed space. This also what NIST recommends[2]: > #16 Digit spacing > The digits of numerical values having more than four digit…

There are much more variants. E.g. Russia uses space for thousands and decimal comma. And I may be mistaken, but I believe in Japan the grouping is by four digits, not by three.
Post reply on HN