Skip to content

Commit d45056f

Browse files
committed
Increase precision for writing floats
1 parent 83b6ce9 commit d45056f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/ifcparse/IfcWrite.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
* *
1818
********************************************************************************/
1919

20+
#include <iomanip>
21+
2022
#include "../ifcparse/IfcParse.h"
2123
#include "../ifcparse/IfcWrite.h"
2224
#include "../ifcparse/IfcWritableEntity.h"
@@ -211,7 +213,7 @@ class StringBuilderVisitor : public boost::static_visitor<void> {
211213
// REAL = [ SIGN ] DIGIT { DIGIT } "." { DIGIT } [ "E" [ SIGN ] DIGIT { DIGIT } ] .
212214
std::string format_double(const double& d) {
213215
std::ostringstream oss;
214-
oss << d;
216+
oss << std::setprecision(16) << d;
215217
const std::string str = oss.str();
216218
oss.str("");
217219
std::string::size_type e = str.find('e');

0 commit comments

Comments
 (0)