]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/InitializationPlugin/InitializationPlugin_EvalListener.cpp
Salome HOME
Issue #19036: Can't use a parameter with 1e-5 value in the sketcher
[modules/shaper.git] / src / InitializationPlugin / InitializationPlugin_EvalListener.cpp
index 03f812776ccde54067a4c4bcbc02b203e4f4b8fc..a8265d4414505b94c12678d0c01b7a6435c81c5c 100644 (file)
 std::string toStdString(double theValue)
 {
   std::ostringstream sstream;
-  sstream << theValue;
-  size_t aPos = sstream.str().find(".");
-  std::string aPnt = "";
-  if (aPos == std::string::npos)
-    aPnt = ".";
-  return sstream.str() + aPnt;
+  // write value in scientific format with 16 digits,
+  // thus, not check the dot position
+  sstream.precision(16);
+  sstream << std::scientific << theValue;
+  return sstream.str();
 }
 
 std::set<std::string> toSet(const std::list<std::string>& theContainer)