mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 04:08:04 +00:00
Increase precision for writing floats
This commit is contained in:
@@ -17,6 +17,8 @@
|
|||||||
* *
|
* *
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
|
#include <iomanip>
|
||||||
|
|
||||||
#include "../ifcparse/IfcParse.h"
|
#include "../ifcparse/IfcParse.h"
|
||||||
#include "../ifcparse/IfcWrite.h"
|
#include "../ifcparse/IfcWrite.h"
|
||||||
#include "../ifcparse/IfcWritableEntity.h"
|
#include "../ifcparse/IfcWritableEntity.h"
|
||||||
@@ -195,7 +197,7 @@ private:
|
|||||||
// REAL = [ SIGN ] DIGIT { DIGIT } "." { DIGIT } [ "E" [ SIGN ] DIGIT { DIGIT } ] .
|
// REAL = [ SIGN ] DIGIT { DIGIT } "." { DIGIT } [ "E" [ SIGN ] DIGIT { DIGIT } ] .
|
||||||
std::string format_double(const double& d) {
|
std::string format_double(const double& d) {
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
oss << d;
|
oss << std::setprecision(16) << d;
|
||||||
const std::string str = oss.str();
|
const std::string str = oss.str();
|
||||||
oss.str("");
|
oss.str("");
|
||||||
std::string::size_type e = str.find('e');
|
std::string::size_type e = str.find('e');
|
||||||
|
|||||||
Reference in New Issue
Block a user