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
Hello @JonoPrest That's how floating point numbers work. You hardly get a very precise one. Typically you can use a format string like "{:.2}" for that
Hello @JonoPrest That's how floating point numbers work. You hardly get a very precise one. Typically you can use a format string like "{:.2}" for that
Hey @sunng87 I understand that's how they work but why is the rendering in hbs giving "0.800000011920929" while standard rust fmt implementation gives "0.8" on the same number? And why does it only do it when rendering from a struct and not just a standalone f32?
Something is going wrong with floating point precision when rendering values inside a struct.
It works to render just the f32 value, and just to double check it also works to use rusts format implementation on the nested value.
But rendering nested struct value with hbs fails. The last assertion in this test fails with:
assertion
left == right
failedleft: "0.800000011920929"
right: "0.8"
The text was updated successfully, but these errors were encountered: