-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support both .
and ,
as decimal separator when entering numbers
#153
Comments
This is your friendly Microsoft Issue Bot. I've seen this issue come in and have gone to tell a human about it. |
For ambiguous cases, marking them and offering the user some kind of UI to point out the right character or place a new one would be much more user friendly than rejecting the input. Also, all Unicode spaces should probably be treated as digit grouping character (i.e., silently dropped), whether pasting or typing the number. |
In the discussion of PR #145 some ambiguities were shown. Update: that PR was just locked to comply with contribution process. I'm waiting to see which issue will be used for discussion. |
@ThiefMaster Thanks for submitting your idea! We agree there is likely something we can do to improve this experience, but it would be good to refine the idea a bit more before moving forward.
We agree that regardless to your PC's language settings, we should be able to handle pasted input with both separators. Is this what you had in mind? Or would you expect the ability for a user to type input with physical or in-app keyboard to do the same? In general, we want to respect the system settings for direct input. If you prefer one style over the other, you can change this in your language settings.
I agree this can be tricky, and maybe we can figure out the details later, but can you clarify what you mean in this case? For example, what would you expect if I pasted "123.456"
We worry that this might easily become too complex, and in general, we want to avoid blocking UI like popups. Ideally, we can handle all scenarios more fluidly without requiring additional user action. @KillyMXI We should use this issue to track improvements to this, so let's keep the conversation here until we figure out how to tackle this. |
Yes, that's indeed what I had in mind. Like I said, on Windows 7's calc this worked just fine. |
General conference on weights and measures say: So I think it is reasonable that:
Examples: I think this should be the same for pasted input or typed input. Any calc documentation on numerical entry should point out the importance of numerical unambiguity across cultures, and they should be using , or . for decimal place and either a thin space or nothing at all as both a thousandth or thousands separator. |
Since I just got reminded of this issue thanks to the (very interesting!) comment, another idea regarding this came to my mind:
If you type a number, chances are good that you will never enter thousands separators. So I think for that case it makes sense to accept both |
Unless you're copying and pasting a number from somewhere else that was formatted that way.... |
Sure, but it's easy to detect whether it's copy&paste or actual typing. |
@ThiefMaster: I agree. That also complies with Weights and Measures, so I like your one better for typing. You can expect the user to copy/paste text written by non-compliant authors though, in which case my disambiguation cases should be used. @HowardWolosky: copy paste and typing are different code areas. |
@I-Campbell what is the standard you are suggesting compliance to, and how is it better for end users than CLDR? |
https://www.bipm.org/en/CGPM/db/22/10/ These guys do the SI units. CLDR is for what the user is likely to enter, but fails to recognise that the user is a global citizen and may be copy pasting from a website from another country. |
@I-Campbell Thanks. Some of the behavior you propose is breaking (i.e. changes what the calculator, both Win32 and UWP, currently does for the same input). This issue seems to propose both the dot and comma keys to be treated as a decimal separator, the same way Win32 calculator does it, which would on its own be a significant improvement. The discussion seems to have been focusing on resolving ambiguities, but the calculator already supports pasting values, for both "10,000" and "10.000", so perhaps if users are unsatisfied with how that currently works, a new issue should be opened. Don't forget that user can set the decimal and grouping separator to be the same character, and/or more than one character (the UWP uses the first character only though, unlike Win32). |
A compromise could be to make the new behavior optional. Personally, I never use the thousands separator when typing a number, and it's rarely present in numbers I try to copy/paste, so I'd like to interpret '.' as the decimal separator, even though in my locale (French) the standard separator is ','. |
I think nobody uses thousands separator when write a number... Isn't more logicall respect the decimal separator of language configuration and ignore thousands separator? |
More logical, maybe, but not necessarily more convenient. The decimal separator in my language is ',', but as a programmer I'm used to use '.'. So I'd like to be able to use either. |
This pitch looks like it has everything it needs for review. In the meantime, we'll keep this idea open for discussion so the community has the chance to provide feedback. Check out our New Feedback Process for more info on the user-centered process we follow for new feature development. |
I just can't copy numbers from calculator anymore: 10,023,100 is NOT treated as 10023100! Why on earth should I copy the FORMATTED numbers? The main problem is with the websites who check if the pasted value is ASCII characters and they just fail after I paste "," and "save the memory about my pasted values" until I hide the input field (Hello AWS S3 headers parameter section!). Can we just COPY the number from calculator WITHOUT grouping commas? I really don't even want such "grouping", but there is no option to disable that feature. |
Thank you to everyone for the great discussion on this issue. We had the chance to review the idea more closely, and we feel like we need more information before deciding whether to continue. First, the support we have today for accepting pasted values when they are formatted to align with your system settings has one key benefit--it is consistent and predictable with how numbers are represented throughout the rest of the system. That being said, we definitely understand the user pain point this change is seeking to address. We are generally supportive of this pitch, as long as we can consistently and predictably handle pasted input regardless to what your region's thousands and decimal separators may be (comma, period, space, etc.) The ambiguous cases are the problem. Is "100,000" "one hundred" or "one hundred thousand"? Thanks to folks who have proposed rules above, but we don't think we've landed on a good set of rules here. Unlike #162, where there is only a possible loss of precision, making the wrong assumption here can result in huge swings in order of magnitude. We cannot think of a good way to confidently determine one way or another, so we would like to keep this idea and discussion alive and take another look once we have clearer set of rules we can follow. |
I think, at least for the first ambiguous paste you will have to interrupt the user.
|
Let me explain more. The real problem in my case was is not even 100,000 or 100.00 or 100000: many web services accept only integers (almost all, even in HTML standard number field there is clear INT), and not when I do |
Yeah I think copying should strip anything except the decimal point, and pasting should try to be smart - if there's only one way to parse use that, otherwise prompt the user. And when typing... well, nobody types thousands separators, so both |
@0x49D1 you talk about different issue from what is discussed here, I believe. |
I can see the appeal of a configuration-free and dialog-free application in the smartphone era. But it also puts irresolvable constrains, making the app the least useful for the real world. I was going to refine my parser logic suggestion before posting it here. But it looks like more fundamental roadblock have to be moved first. My suggestion is to add alternative paste command and alternative parser. Also refine existing parsers for all modes while at it.
All parsers:
Fall-through rules (inspired by comments in #162):
This way, the main track will remain consistent and dialog-free. But there will be a flexible alternative to deal with real world scenarios. I also have to note that "consistent" is not "error-free". I still have to pay attention, or Calculator will ignore the decimal separator when I paste |
I like @KillyMXI's suggestion. Another way of handling this would be to show a hint on paste, like in Word: For instance, if the user pastes "100.000", parse it as |
@thomaslevesque I love the paste options dialogue idea. Everyone is familiar with that functionality. It also doubles as a known keyboard shortcut, as everyone knows from word that you can press Ctrl+V, Ctrl, and then a key for each of the options. M for Mine, E for Europe, A for America, S for Standards? |
@leduyquang753 this doesn't look like a source you can select text from and paste into the calculator, and even if you have a formatted text, it will be most likely pasted as 2.10-7 so you have other issues to solve first. Do you have an example where the dot is used for multiplication but not by powers of ten? |
|
@miloush @leduyquang753 this better be discussed in the linked issue. #1251 For the current issue, it's sufficient to mention that in some cultures full stop can even be not a separator but a mathematical operation. |
Because of this issue, it's also not possible to copy results from converter to the calculator, which is very annoying. But it seems that this topic is dead, last update was almost two years ago. |
While there is no definitive decision on how to handle copied numbers, the base principle of allowing for different user input is not influenced. I would therefore suggest to allow for both ',' and '.' as direct input via the keyboard, as this does not directly interact with pasting numbers. |
This issue is 3 years old and still unsolved! There is a lot happening and could and should be split into multiple issues, with the first one being support for both Second issue: parsing. A lot of proposals have been made and I won't repeat what has already been said. I think we should always accept any valid format just as is when there is no ambiguity (ex: 1000.5 should always be parsed as 1000 + 5/10 because there is no alternate valid interpretation). In case of ambiguity, locale format should be used first (ex: 100,000 in french should be treated as 100 because Third issue that no one have pointed out so far: adding an option for changing the locale of the application, regardless of PCs one. I'm set up in french canadian, but as a programmer I always use |
Either that or make it possible to change the decimal separator manually in the app's settings. I was about to open a bug report because I changed my OS to English and it's still trying to use comma as a decimal separator like it is in the language the PC came with. But then I found this and decided to support this one instead. I'm a programmer and I'm used to doing everything in English and that includes working with numbers. Using the dot is muscle memory and I get calculation mistakes all the time because of this. I didn't have this problem in previous versions of Windows. It used to work with both dot and comma. Please fix this. If anybody also have a Feedback Hub entry, please send a link for me to support there as well |
I might as well chip in from Sweden. Whenever I type a number I automatically hit the . (dot) in the calculator for decimals, and it's just discarded and I end up with the wrong number... again and again every month. It's actually easier to use google/chrome for the math as it doesn't care. And I do know that we should use , (comma) but I just simply use too many US software programs every day... |
5 years later, same problem... :/ |
@grochocki, maybe we could deal with this issue as two separate issues. One to deal with typing, which has a clear unmistakable solution, which is to whenever you hit |
Problem Statement
The Windows 7 calculator allowed users to enter both
.
and,
as the decimal separator. This is very convenient because while certain locales uses,
(e.g. German) as the decimal separator, it's still very common on websites, applications, etc. to use the.
separator. Supporting both allows for flexibility when entering values.Evidence or User Insights
The calculator in Windows 7 supported this.
Proposal
The calculator should accept both
.
and,
as a decimal separator.Goals
User can enter both
.
and,
as a decimal separatorThe only tricky point I see here is how pasting numbers should be handled:
The text was updated successfully, but these errors were encountered: