Android - decimal & range input not working


(Eric M) #1

I have been trying to get negative decimal values as an option for some of my device handlers for several months. It either does not work on iOS or does not work on Android. It used to work fine on Android, but not on iOS. Seems a recent update has flipped this. Here are some simple examples:

input "parameter200", "decimal", title:"Temperature Offset", range: "*..*"

Or

input "parameter200", "decimal", title:"Temperature Offset", range: "-100..100"

Andriod:
Cannot enter decimal values. Either negative or positive.

iOS:
Works as expected. Both negative and positive numbers.

input "parameter200", "decimal", title:"Temperature Offset", range: "-100.0..100.0"

Andriod:
Error when entering preferences page.

iOS:
Works as expected. Both negative and positive numbers.

Removing range all together makes it so you cannot enter a negative value on iOS (which is explained in the developer documentation).

@slagle, @duncan, or anyone else know if we can get a resolution for this issue?


(John C) #2

Was this ever fixed? @slagle @duncan

I’m playing with something similar. On iOS, if I enter certain decimals such as 8.3 and save the preference, next time I open preferences it comes up as 8.300000000000001

Same problem? Different problem?

Adding some logging in updated() shows the correct value of 8.3 which leads me to believe it is an iOS display problem. Perhaps it does the same on Android, but I don’t know…