Hacker News new | ask | show | jobs
by Waterluvian 490 days ago
How do people who use commas as decimals disambiguate 1,004 and 1.004 without changing the precision implied by number of decimal places?
7 comments

You are trying to apply what you know versus what others know. No different than Farenheit vs Celsius or Yard vs Meter.

Personal, the MM/DD/YYYY format, that is stander in the USA, needs to die and be replaced with YYYY-MM-DD.

Same with 12 hour time and replacing it with 24 hour. As the saying goes l, Americans use am and pm because they can't count past 12. AM and PM are a waste of code and display area. What fits in 2 characters takes up 5 characters.

No excuse for the date, but I get the 12/24 hour clock. 12h feels more natural when spoken. Where I'm from, we speak in 12h but always write down 24h. You'll see "20:00" written down, but you'll say "8 in the evening". We don't use am/pm, though.
It depends on the local norms. Where I live, 1,004 is decimal, 1 004 or 1'004 is 1004 which makes it even more clear than the en-US default. That is, the 1.004 variant is never used, and if it is, it is assumed to be a decimal (misspelling) of 1,004.
So is there no such thing as "100,000,004" and having no idea if that's a decimal or a thousands separator?
Not sure where OP is from, but in my whereabouts „100,000,004“ wouldn’t show up in the wild. We use spaces to separate if really needed.
Ah makes sense. In Canada we were taught to use spaces to separate, and decimals for decimals. But being stuck so close to the US we end up with a mess of everything.
In Denmark for example the decimal and comma are reversed in meaning, so you would not have a Danish 100,000,004 because that is an obvious non-Danish number.
You don't. It's ambiguous. Just like the string 01/03/2025 is if you don't know the source's locale.

But it can be worse. Los Angeles, Sunday, November 2, 2025, 2:00:00 am is ambiguous. Is it PST or PDT?

That's not an ambiguous date because Nov 2 2025 is PST, not PDT.
What I used to do is set the thousands separator to ' in the operating system settings. That made Excel read CSV files with 1,004 and 1.004 the same, as one and four thousands. No one puts thousands separators in CSV files anyway, so that worked out. And it looked nice too.

In today's Windows 11 I can't find that setting. You can't set the thousands separator separately, not anywhere that I can find. It's a tragedy. I see Excel misreading CSV files all the time. I don't use Excel that much myself and I understand what's going on, so it doesn't affect me all that much directly, but for my Excel warrior colleagues, it's another matter.

You have to set it for the whole OS... it's like someone who works at Microsoft decided that you should never work on a file generated in a different locale.
If you need to apply a setting like that to a single application only, there are ways to create a program that will detour all the registry reads.
I'm sure there are -- but I'm not doing all of that for a one-off thing.
Wait, can you tell me how to set it for the whole OS? Then please do!
How do people who use periods disambiguate it? It’s simply ambiguous without context.
I mean, if that's how you write numbers, it's the same as disambiguating 1,004 and 1.004 if you use EN-us norms.

Which is to say, you assume it's as written, unless context suggests otherwise.

The same way as people who use periods. 1,004.004