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…
Commas in big numbers everywhere: An OpenType adventure
31–40 of 43 posts
Re: Commas in big numbers everywhere: An OpenType adventure
#32Could this be an potential avenue for some sort of exploit? I had no idea that you could "execute" logic via fonts.
Uh oh. Are fonts now Turing-complete?
Re: Commas in big numbers everywhere: An OpenType adventure
#33Probably cool, but the website disables zooming in phones so I can't tell. I wish pages couldn't disable zooming -- that should be up to me. Does anyone know browsers that always allow zoomi (If any Jane Street blog folks read this, please fix your blog.)
Re: Commas in big numbers everywhere: An OpenType adventure
#34AFAIK 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…
Also, this is locale specific. Here in Germany we use dots instead of commas for that.
(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
#35I turn it on my Windows calculator, and I’m also happy that now programming languages like JavaScript, Python and recently Go allows using underscores in numeric literals for doing this in code to make it more readable.
Re: Commas in big numbers everywhere: An OpenType adventure
#36AFAIK 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…
Also, this is locale specific. Here in Germany we use dots instead of commas for that.
> #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:...
Re: Commas in big numbers everywhere: An OpenType adventure
#37Earlier quoted context omitted.
Also, this is locale specific. Here in Germany we use dots instead of commas for that.
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.)
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
#38I wonder why not to use scientific exponential notation. Once you get used to it, it comes really handy to compare numbers of many magnitudes.
Re: Commas in big numbers everywhere: An OpenType adventure
#39Earlier quoted context omitted.
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.)
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.) )
ZHP seems like it's unlikely to be used in the wild.
Re: Commas in big numbers everywhere: An OpenType adventure
#40I suppose the same is true of continental Europe's '1.234', though it would be very cool if it could be determined that the '.' was a thousand separator and modified to ','.
What happens though if the text is using '.' separator and ',' decimal, such as (roughly 123 and a half) '123,456789', is it going to determine there's a missing ',' between '6' & '7' (making it roughly 123 and a half million)?