-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Use decimal value separator depending on locale ("." or ",") on EditTextActivity #2998
base: master
Are you sure you want to change the base?
Use decimal value separator depending on locale ("." or ",") on EditTextActivity #2998
Conversation
Use decimal value separator depending on locale ("." or ",")
Can I recreate the problem by choosing the Ukrainian language and then doing what? |
Then go to the alert list -> edit or add a new alarm. |
Screenrecorder-2023-08-12-18-25-48-106.mp4 |
I've chosen mmol/L. |
See the video above, please. |
Yes, if you leave the comma then it works. If you delete, then you can enter only "." and the fractional part will be dropped.
You can't use "," in this case, because the current implementation is locale independent and allows entering only dots from your keyboard.
|
You're right. The description might've been more elaborated. Sorry for taking your time. |
Thanks for reporting the problem and suggesting a fix. |
This is a perfectly reasonable and useful change. The problem is that this particular activity is in a very old part of the code and in other places we have had to be careful with parsing numeric values containing separates other than |
Thank you for the insights! The code that I used here is just for enabling entering decimal separator to the |
@jamorham Is there anything I can do to help move this forward? |
@jamorham Please tell me how to test what concerns you. Or, please merge this and if we discover issues, we will redact and fix then. After all, it is a Nightly. Thanks |
As a german I've got the same problem. If parsing "comma" as a numeric value is a problem, there might be another "fix": Main Menu / "Glucose Levels" require a seperator as well, when using mmol. |
If you attempt to enter a threshold for the persistent high alert, do you experience the same problem? |
When creating a new alarm and entering a decimal threshold value some European languages (Ukrainian, for example) languages use
,
for fractions. However, the xDrip keypad does not allow you to use,
. In this case, if you enter 4.3 it'll be parsed as 4,0. To avoid that we have to use a decimal line separator depending on the current locale.Additionally, when
alertThreshold.setKeyListener(DigitsKeyListener.getInstance("0123456789" + decimalValueSeparator));
is applied there is no need to set input type because DigitsKeyListener.getInstance modifies that anyway.Part of the documentation for
setKeyListener