From 63f6397f72aa2978c1b639e4b0da55e01138f1e2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Fri, 15 Apr 2011 23:49:16 +0100 Subject: [PATCH] Preserve floating point precision in JSON output. --- json.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 = ' '; } -- 2.45.2