]> git.cworth.org Git - apitrace/blobdiff - retrace/json.hpp
Use appropriate number of digits when dumping floating point numbers.
[apitrace] / retrace / json.hpp
index 14ff501f5681777a19a56b8321643d2e68239388..6af1f4c6c4fab898fae8ca730c5092cefc850459 100644 (file)
@@ -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 = ' ';
         }