Skip to content

Commit 604358b

Browse files
committed
Increase precision for writing floats
1 parent 68e60f0 commit 604358b

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/IfcFile.h"
2224
#include "../ifcparse/IfcWrite.h"
@@ -197,7 +199,7 @@ class StringBuilderVisitor : public boost::static_visitor<void> {
197199
// REAL = [ SIGN ] DIGIT { DIGIT } "." { DIGIT } [ "E" [ SIGN ] DIGIT { DIGIT } ] .
198200
std::string format_double(const double& d) {
199201
std::ostringstream oss;
200-
oss << d;
202+
oss << std::setprecision(16) << d;
201203
const std::string str = oss.str();
202204
oss.str("");
203205
std::string::size_type e = str.find('e');

0 commit comments

Comments
 (0)