I am using NewtonSoft's JSON.NET assembly to load a .json file in a C# console application. I think I have done most of the work except I am finding that some negative float values are being rounded.
Here is relevant code; as you can see, I have tried both load
and parse
methods but same results.
string content;
using (StreamReader reader = new StreamReader("C:\\[Path]\brackett_full_room.json"))
{
content = reader.ReadToEnd();
}
//// JObject rss = JObject.Load(reader);
JObject rss = JObject.Parse(content);
The original values are like:
"geometry" : { "rings" : [ [ [ -9221300.3411999997, 4120326.8838 ],
[ -9221300.2146000005, 4120327.992399998 ]...
But -9221300.3411999997
becomes something like -9221300.3412
in the rss
variable and that is causing the coordinates to not work; the long positive values are fine.
Is there some way to keep precisions high enough (i.e. should have enough digits if parsed as double
instead of float
)?