summaryrefslogtreecommitdiff
path: root/retrace
diff options
context:
space:
mode:
authorJosé Fonseca <jose.r.fonseca@gmail.com>2012-05-14 20:20:44 +0100
committerJosé Fonseca <jose.r.fonseca@gmail.com>2012-05-14 20:20:44 +0100
commit5f2245e7500f9024ba90e631fd865c9ffac172c2 (patch)
tree3e04ac3e958b5f0bc5c287fc02e6cd9ea18e9dc9 /retrace
parent9db0c7a850e85ced1a7db0b5a42aa140385eaa32 (diff)
Use appropriate number of digits when dumping floating point numbers.
Diffstat (limited to 'retrace')
-rw-r--r--retrace/json.hpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/retrace/json.hpp b/retrace/json.hpp
index 14ff501f..6af1f4c6 100644
--- a/retrace/json.hpp
+++ b/retrace/json.hpp
@@ -35,6 +35,7 @@
#include <wchar.h>
#include <iomanip>
+#include <limits>
#include <ostream>
#include <string>
@@ -332,7 +333,7 @@ public:
writeNull();
} else {
separator();
- os << std::dec << std::setprecision(9) << n;
+ os << std::dec << std::setprecision(std::numeric_limits<T>::digits10 + 1) << n;
value = true;
space = ' ';
}