Properly handle scientific notation when parsing quantities. (#601)
Properly handle scientific notation when parsing quantities. (#601)

Quantity values can sometimes contain scientific notation. For example
7E+1 °F (70 degrees Fahrenheit).

To calculate the up/down steps, we of course have to parse this
value. The current logic fails to parse the scientific notation,
resulting in parsing the above as "71" (after stripping out the `E`
and `+`). This of course leads to weird behavior when using the "up"
and "down" buttons--e.g. hitting "up" on 70 skips 71 and jumps to 72.

This fixes the parser to accept scientific notation. There appears to
be no negative effects on non-scientific notation strings, which
happily parse as well.

Signed-off-by: Lucas Christian <10c25665e49274c39b8e8f7ad6e2a3d0b0bc5052@lucasec.com>
openhab/openhab.ios