From c3aecc68319cfdc097b63c490449f089bb5c14a0 Mon Sep 17 00:00:00 2001 From: Stefano Fiorentino Date: Fri, 12 Feb 2016 12:58:44 +0100 Subject: [PATCH] forward precision to stringstream --- src/lib_json/json_writer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp index a07fbc9..b1adaa6 100644 --- a/src/lib_json/json_writer.cpp +++ b/src/lib_json/json_writer.cpp @@ -143,7 +143,7 @@ std::string valueToString(double value, bool useSpecialFloats, unsigned int prec int len = -1; std::stringstream value_ss; - value_ss << std::setprecision( 17 ) << value; + value_ss << std::setprecision( precision ) << value; std::string value_str = value_ss.str(); // Print into the buffer. We need not request the alternative representation