From ca1f68949cd4b373a7246c813c8754f5aee17be3 Mon Sep 17 00:00:00 2001 From: Christophe Bourcier Date: Tue, 26 Jan 2021 17:26:47 +0100 Subject: [PATCH] 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 --- src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx | 5 +++++ 1 file changed, 5 insertions(+) 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); -- 2.39.2