Closed matthew-e-brown closed 2 years ago
Could we use '
for digit seperator? not only do some people have troubles seeing the difference between ,
and .
some fonts can greatly exacerbate this issue. and digit separators can differ greatly depending on country. using '
is not uncommon in computing either.
Personally, I have never seen '
before. If this is meant to be a calculator "for people," I think sticking to combinations of ,
and .
is for the best—being used in computing is only really going to mean something to people who work with computers. Most places in the world use some combination of ,
and .
.
that completely dismisses the problem instead of addressing it, many people with sight impairments can find issues telling the difference between periods and commas. if the point is to use a mark to denote digits, instead of just using a space, then something like an apostrophe would do better the SI explicitly says not to use periods or commas to denote digit intervals. an apostrophy is used to denote the presence of a space where it would otherwise not be possible (IE. simple physical calculators)
following SI being pretty much the only internationally accepted for of measurement would probably be a good idea.
My only gripe was the lack of consistency (sometimes ,
-.
, sometimes .
-,
), I never the considered hard-of-sight perspective.
I'm all for following SI conventions, I just don't know how many people use that in their day-to-day, which was my focus; I feel like more familiar would be better than more proper.
That's just me, though. I'm happy to concede. 🙂
Sorry for the difference regarding the dot and comma separation. Previously, I thought of numbers and money types as different items and made arrangements accordingly. The easiest way to solve the problem will be to read the system locale configuration and apply those parameters. I will work on that. Thanks for sharing your thoughts.
Changes are done, merged into master branch and updated web repository. Web browser's decimal and thousands separator is used. Please validate it then I will close issue.
When typing a currency, SmartCalc uses
,
for the thousands separator, and.
for the decimal point, as is standard in both UK- and US-English.However, when a regular number is used,
.
is used for the thousands separator.This is inconsistent, and creates confusion. The calculator also does its best to guess what the user wants when given numbers that have commas and periods in them, but it gets tripped up pretty badly.
1.5
has its decimal point ignored, but1,5
is read as one-thousand-five-hundred; however, this time, it is displayed as1,500
instead of1.500
, like was the case with1800
: another inconsistency.1.05
and1,05
—the decimal point is ignored, the comma is misread as a thousands-separator and the calculator fills in the missing trailing zero.Furthermore, when it comes to large, 1,000+ numbers that have decimal portions, the calculator seems to just spit out whatever it wants:
1800.50
becomes...180.050
? The decimal place has been shifted to the left by one place.1800,50
becomes1.800,500
, again returning to the.
as a thousands separator, which seems to be consistent with how it handles regular numbers (like1800
); however, it also adds a trailing zero for no reason.,
thousands separator is used in the number, then the calculator decides to truncate the decimal place and simply round to the nearest integer:1,800.75
becomes1,801
again, inconsistently using a,
for the thousands separator..
thousands separator (and,
decimal point) is used, the calculator again adds a trailing zero, though it does seem to parse the number correctly:1.800,75
becomes1.800,750
.When it comes to fixing this issue, obviously the calculator must be made consistent, and should pick
.
-,
or,
-.
. For user-input, however... one could either enforce the same notation style that the calculator outputs, or it could do its best to figure out which is which from the user. For example, if there are less than three or more than four numbers after the separator, it is most likely a decimal point. However, if there are more occurrences of the same separator later in the number, then it is probably the thousands separator. The other can then be assumed for the decimal separator.i18n is a nightmare... :smile: