wangxiaowei0303 / rapidjson

Automatically exported from code.google.com/p/rapidjson
MIT License
0 stars 0 forks source link

Allow control over Writer's floating point precision #67

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When writing large JSON documents, it may be useful to limit the number of 
decimal places in the textual form of a document.

I would like to provide the number of decimal places when calling 
{{writer.Double}}.

Some further discussion here: 
http://stackoverflow.com/questions/16104558/set-floating-point-precision-using-r
apidjson

Original issue reported on code.google.com by drewnoakes on 19 Apr 2013 at 2:03

GoogleCodeExporter commented 9 years ago
You can find an implementation proposal for this functionality in a 
pull-request in my personal fork at GitHub, see 
https://github.com/pah/rapidjson/pull/3

In addition to explicitly specifying a precision with each writer.Double() 
call, you can tell the Writer classes to use a user-defined precision via
  writer.SetDoublePrecision(...);

Pull-request: https://github.com/pah/rapidjson/pull/3
Latest patch: https://github.com/pah/rapidjson/pull/3.patch

Original comment by philipp....@gmail.com on 2 Apr 2014 at 4:07

GoogleCodeExporter commented 9 years ago
Issue 68 has been merged into this issue.

Original comment by milo...@gmail.com on 26 Jun 2014 at 2:44

GoogleCodeExporter commented 9 years ago
https://github.com/miloyip/rapidjson/pull/19

Original comment by milo...@gmail.com on 26 Jun 2014 at 2:45