From f3622f933958d3cd445c163d858a7e6effa39861 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Wed, 11 Jun 2014 10:24:11 +0000 Subject: [PATCH] Increase precision for writing floats --- src/ifcparse/IfcWrite.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ifcparse/IfcWrite.cpp b/src/ifcparse/IfcWrite.cpp index 87685dd1e6..64f62fce5f 100644 --- a/src/ifcparse/IfcWrite.cpp +++ b/src/ifcparse/IfcWrite.cpp @@ -17,6 +17,8 @@ * * ********************************************************************************/ +#include + #include "../ifcparse/IfcParse.h" #include "../ifcparse/IfcWrite.h" #include "../ifcparse/IfcWritableEntity.h" @@ -195,7 +197,7 @@ private: // REAL = [ SIGN ] DIGIT { DIGIT } "." { DIGIT } [ "E" [ SIGN ] DIGIT { DIGIT } ] . std::string format_double(const double& d) { std::ostringstream oss; - oss << d; + oss << std::setprecision(16) << d; const std::string str = oss.str(); oss.str(""); std::string::size_type e = str.find('e');