Jump to content

  • Log In with Google      Sign In   
  • Create Account

shuma-gorath

Member Since 14 Apr 2003
Offline Last Active May 23 2016 09:21 PM

#5264312 How to Stop json-cpp from Injecting Decimal Points

Posted by shuma-gorath on 30 November 2015 - 03:24 PM

Thanks for the reply.

 

So, yes, the number is integer timestamp since the Epoch (e.g. 1422982952874000).  Looking over things today, it appears that only JsonView was showing the E+ notation.  However, json-cpp is still appending  decimal points to my timestamps.

 

The built-in writers for Json-cpp can optionally take stream, though I see this behavior with and without, and following your advice about the precision.

 

When I get a chance, I'm going to try a few things and update this thread.

 

UPDATE: I have updated the thread title to reflect the fact the the problem has to do with the trailing decimal points.




#5264167 How to Stop json-cpp from Injecting Decimal Points

Posted by shuma-gorath on 29 November 2015 - 06:21 PM

Suppose I read in a JSON file and write out to the same file without changing the JSON at all.  Now, when I do this, json-cpp enforces E+ notation on big numbers, and I have found no way to turn it off.  In my case, I'm working with timestamps, so it's essential to preserve the numbers in their original form.

 

Is there any way to turn off this E+ stuff, or is there another C++ JSON library that can do this?

 

Thanks.




#5085653 Make an exe start with windows?

Posted by shuma-gorath on 13 August 2013 - 03:24 PM

Just for completeness, I'll add that you can also do this with the Task Scheduler API using a boot trigger.




PARTNERS