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
I wouldn't call this a Tomlyn bug - it's getting 0.100000001 from your code since that's what a 32-bit floating point is stored as in memory (well base 2, but the equivalent is that). You could switch to double or decimal depending on your use case to reduce imprecision, but I don't think Tomlyn should change the value it's getting based on assumptions about the input being base 10 and the user's aesthetic preferences. A custom converter is probably where any such logic could stay, in my opinion.
I apologize, it looks like it may be possible to improve the situation, although I'm uncertain if we can do so with the built-in formatters in .NET. 026f953
It seems like floats < 1.0 get serialized weird. For example, .1 gets serialized as 0.100000001 and .99 gets serialized as 0.99000001.
The text was updated successfully, but these errors were encountered: