-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loss of Precision when Serializing floats #320
Comments
I expect the same issue. |
This should be ok: value.ToString("R", CultureInfo.InvariantCulture) |
… double - Crash with serializing/deserializing double.MinValue
@dandago I created a PR for this issue. Feel free to use my fork if you need this fix. |
@Jerome2606 thanks for looking into this. It has been over a month since I opened this issue, which seems like a stretch for something so small. Is Jil still maintained at all? |
It seems no, and that's so weird. I'm using Jil.JSON and Newtonsoft in my production environment. @kevin-montrose Can you check on the pull request or give the right to anybody to maintain this project ? |
Hi,
When using this code:
I am getting this output:
I would like to preserve the precision but it seems like the number is being rounded. This behaviour is explained here.
I can see this is happening in this method of
ThunkWriter.cs
:In fact simply doing
100921.688f.ToString()
gives the same result shown earlier.I've also tried serializing the same thing with JSON .NET and it does not have this problem.
The text was updated successfully, but these errors were encountered: