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
In Python, float("43,0") raises an error. In Jinja, |float handles that error by using the default, which defaults to 0.0. If you want different behavior, you'll need to register a different float filter.
float(value, default=0.0)
Convert the value into a floating point number. If the conversion doesn’t work it will return 0.0. You can override this default using the first parameter.
Hey guys,
I came over from the home-assistant community to report an issue we found.
We are trying to convert a comma seperated decimal (as string) to float.
additional info: in germany we always use the comma as seperator
Expected Behavior
the result should be 43.0
Actual Behavior
the result is 0.0
Template Code
Full Traceback
Here is the full discussion instead:
DISCUSSION
The text was updated successfully, but these errors were encountered: