Open YPOC opened 7 years ago
Hey, sorry for such a delay in responding.
I think this maybe the string to decimal function cleaning "0,55" to 055.
Can you confirm that if you enter "0.55" (dot, not comma) works correctly?
First I tried only replacing the decimal places, leaving the dot in place, but 0.55 became 55. Then I tried using the dot as decimal point, but 0.55 still became 55. When I press the comma on my keyboard nothing gets inserted.
ok, thanks, ill perform some tests and get back to you. Does 1.55 work ok?
On Fri, 9 Jun 2017 at 11:15 YPOC notifications@github.com wrote:
First I tried only replacing the decimal places, leaving the dot in place, but 0.55 became 55. Then I tried using the dot as decimal point, but 0.55 still became 55. When I press the comma on my keyboard nothing gets inserted.
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/timomer/HAPP/issues/61#issuecomment-307339142, or mute the thread https://github.com/notifications/unsubscribe-auth/AE_kFOvRrAdQWXv8QRySEME50X0xEoz2ks5sCQ1FgaJpZM4NlCnd .
-- IT Consultant, Diabetic Hacker | www.twoit.co.uk
1.55 becomes 155 as well.
Ok, thanks, that is odd, ill get a Android 7 DE VM setup
On Fri, 9 Jun 2017 at 11:25 YPOC notifications@github.com wrote:
1.55 becomes 155 as well.
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/timomer/HAPP/issues/61#issuecomment-307341452, or mute the thread https://github.com/notifications/unsubscribe-auth/AE_kFIclC4Lj2CTq-OxSfuMnm1wiPArcks5sCQ-egaJpZM4NlCnd .
-- IT Consultant, Diabetic Hacker | www.twoit.co.uk
Hey @YPOC , please test the following apk. https://drive.google.com/file/d/0BxE8lMx4AjLiNmdieGxmbC1HLU0/view?usp=sharing
So the issue was in two places, first, the edit text box was limited so that only decimal numbers with a "." can be used. Second, the function that converts a Sting to Double correctly detected you are DE, found a string with a dot "0.55", as this is incorrect for DE as it expected a "," it removes the dot "055".
One option to fix this is to allow the edit text box to enter any number with "," or "." and allow the Sting to Double function to clean it up, but, this could result in an input of a DE user entering "0.55" and it being converted to "055", but "0,55" would work correctly.
I do not like this as it means we have to be sure for locations that use "," as a decimal separator that they never use "."
A better approach is to keep the input fields locked to decimal with "." - this means I can control the user input (even if they don't like it!) and correct the Sting to Double function to never expect ","
Please test and let me know your thoughts?
(Looks like I have already fixed this in Dev and may not have pushed it to master)
When entering carbs or insulin shots with decimal places the decimal point gets omitted, so inputting 0.55 results in 55.0. The same goes for entering the basal profile. I'm using Happ on an Android 7.0.1 phone with the system language set to German, where the default decimal sign is , (comma). It would be nice if it was possible to enter values with either decimal point or decimal comma, currently I have to press the dot for a decimal sign to appear in the input field.