From: Christophe Bourcier Date: Tue, 26 Jan 2021 16:26:47 +0000 (+0100) Subject: Forces C locale to be able to define advanced option with digits X-Git-Tag: V9_7_0a1~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ca1f68949cd4b373a7246c813c8754f5aee17be3;p=plugins%2Fblsurfplugin.git Forces C locale to be able to define advanced option with digits For instance, periodic_tolerance 0.001 in advanced tab was set as 0 before this fix --- diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx index db551c4..038b59b 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx @@ -32,6 +32,8 @@ #include #include +#include + // cascade include #include "ShapeAnalysis.hxx" @@ -3665,6 +3667,9 @@ double BLSURFPlugin_Hypothesis::ToDbl(const std::string& str, bool* isOk ) { if ( str.empty() ) throw std::invalid_argument("Empty value provided"); + // Forces "C" locale to be set as LC_NUMERIC + Kernel_Utils::Localizer loc; + char * endPtr; double val = strtod(&str[0], &endPtr); bool ok = (&str[0] != endPtr);