You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could this be changed to accept both notations? Thanks!
Expected Behavior
Float value 5.605193857299268e-45 should be parsed correctly to the "close to zero" value.
Using an uppercase E works as intended.
Current Behavior
Parsing fails and item is not updated. Log entry is: 2022-09-08 20:51:01.336 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Incoming payload '5.605193857299268e-45' not supported by type 'NumberValue'
Possible Solution
Accept "e" and "E".
Steps to Reproduce (for Bugs)
In my case: Send 5.605193857299268e-45 to an mqtt number channel.
Your Environment
Version used: openHAB 3.3
The text was updated successfully, but these errors were encountered:
abbe79
added
the
bug
An unexpected problem or unintended behavior of the Core
label
Oct 7, 2023
abbe79
changed the title
NumberValue: Parsing floats with a lowercase "e" separating mantissa and exponent fails
DecimalType: Parsing floats with a lowercase "e" separating mantissa and exponent fails
Oct 7, 2023
Hi,
using stable 3.3 I get following entry in my log file when my PV inverter sends really small wattage values at night:
Incoming payload '5.605193857299268e-45' not supported by type 'NumberValue'
Seems like NumberValue/DecimalType/Number does not like the lowercase "e", separating mantissa and exponent.
Using an uppercase "E" (-> 5.605193857299268E-45) works.
While I could work around this using a transformation, I think others could fall in this trap too, because this is the notation that is used by C++ (and probably other languages too), see https://cplusplus.com/reference/ios/scientific/
Could this be changed to accept both notations? Thanks!
Expected Behavior
Float value 5.605193857299268e-45 should be parsed correctly to the "close to zero" value.
Using an uppercase E works as intended.
Current Behavior
Parsing fails and item is not updated. Log entry is:
2022-09-08 20:51:01.336 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Incoming payload '5.605193857299268e-45' not supported by type 'NumberValue'
Possible Solution
Accept "e" and "E".
Steps to Reproduce (for Bugs)
In my case: Send 5.605193857299268e-45 to an mqtt number channel.
Your Environment
The text was updated successfully, but these errors were encountered: