News for hackers. Stuff that matters.
Re:Commas in big numbers everywhere: An OpenType adventure by Mikhail_Edoshin on Saturday October 26, 2019 @03:26AM (#21362269)
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 differently.

Generally the issue should not be handled at the font level, it lacks sufficient context to make intelligent decisions and can never handle all possible cases. The font should just provide the required glyph variants and means to use them.

Re:Commas in big numbers everywhere: An OpenType adventure by trishume on Saturday October 26, 2019 @03:26PM (#21365660)
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 by pojntfx on Saturday October 26, 2019 @04:01AM (#21362402)
Also, this is locale specific. Here in Germany we use dots instead of commas for that.
Re:Commas in big numbers everywhere: An OpenType adventure by weinzierl on Saturday October 26, 2019 @07:42AM (#21363095)
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 digits on either side of the decimal marker are separated into groups of three using a thin, fixed space counting from both the left and right of the decimal marker. Commas are not used to separate digits into groups of three.

[1] https://en.wikipedia.org/wiki/Decimal_separator#/media/File:...

[2] https://physics.nist.gov/cuu/Units/checklist.html

Re:Commas in big numbers everywhere: An OpenType adventure by Mikhail_Edoshin on Sunday October 27, 2019 @07:48AM (#21369147)
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.
Re:Commas in big numbers everywhere: An OpenType adventure by jfk13 on Saturday October 26, 2019 @05:17AM (#21362664)
Fortunately, OpenType fonts can have locale-specific behavior, so as long as your content is appropriately lang-tagged, that shouldn't be a problem.

(Though I still don't think doing this in the font is a good idea, in general.)

Re:Commas in big numbers everywhere: An OpenType adventure by Someone on Saturday October 26, 2019 @08:07AM (#21363154)
So, one could have a font that, say, hides the flag of Taiwan in a Chinese locale? (Yes, there are multiple ‘Chinese’ locales:

  zh-CN Chinese (Simplified, PRC)
  zh-SG Chinese (Simplified, Singapore)
  zh-TW Chinese (Traditional, Taiwan)
  zh-HK Chinese (Traditional, Hong Kong S.A.R.)
  zh-MO Chinese (Traditional, Macao S.A.R.)

)
Re:Commas in big numbers everywhere: An OpenType adventure by yorwba on Saturday October 26, 2019 @08:43AM (#21363294)
Yes, but OpenType only supports 4 different Chinese locales (Chinese, Hong Kong SAR 'ZHH', Chinese Phonetic 'ZHP', Chinese Simplified 'ZHS', Chinese Traditional 'ZHT') https://docs.microsoft.com/en-us/typography/opentype/spec/la...

ZHP seems like it's unlikely to be used in the wild.