mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Make real number parsing and serializing locale-independent, as suggested by Ian Clevy.
This commit is contained in:
@@ -17,7 +17,8 @@
|
||||
* *
|
||||
********************************************************************************/
|
||||
|
||||
#include <iomanip>
|
||||
#include <iomanip>
|
||||
#include <locale>
|
||||
|
||||
#include "../ifcparse/IfcParse.h"
|
||||
#include "../ifcparse/IfcWrite.h"
|
||||
@@ -204,7 +205,8 @@ private:
|
||||
// REAL = [ SIGN ] DIGIT { DIGIT } "." { DIGIT } [ "E" [ SIGN ] DIGIT { DIGIT } ] .
|
||||
std::string format_double(const double& d) {
|
||||
std::ostringstream oss;
|
||||
oss << std::setprecision(16) << d;
|
||||
oss.imbue(std::locale::classic());
|
||||
oss << std::setprecision(15) << d;
|
||||
const std::string str = oss.str();
|
||||
oss.str("");
|
||||
std::string::size_type e = str.find('e');
|
||||
|
||||
Reference in New Issue
Block a user