From: José Fonseca Date: Fri, 15 Apr 2011 22:49:16 +0000 (+0100) Subject: Preserve floating point precision in JSON output. X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=63f6397f72aa2978c1b639e4b0da55e01138f1e2;p=apitrace Preserve floating point precision in JSON output. --- diff --git a/json.hpp b/json.hpp index ee2a9e0..24d9c87 100644 --- a/json.hpp +++ b/json.hpp @@ -295,7 +295,7 @@ public: template inline void writeNumber(T n) { separator(); - os << std::dec << n; + os << std::dec << std::setprecision(9) << n; value = true; space = ' '; }