]> git.cworth.org Git - apitrace/commitdiff
Preserve floating point precision in JSON output.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Fri, 15 Apr 2011 22:49:16 +0000 (23:49 +0100)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Fri, 15 Apr 2011 22:49:16 +0000 (23:49 +0100)
json.hpp

index ee2a9e03b76286646e5dbdabcb0e388890951ac2..24d9c873930d358980c7750572882c3365d7f631 100644 (file)
--- a/json.hpp
+++ b/json.hpp
@@ -295,7 +295,7 @@ public:
     template<class T>
     inline void writeNumber(T n) {
         separator();
-        os << std::dec << n;
+        os << std::dec << std::setprecision(9) << n;
         value = true;
         space = ' ';
     }