8 const char currentSeparator = *std::localeconv()->decimal_point;
9 if (intendedDecimalSeparator != currentSeparator)
12 char* local = std::setlocale(LC_NUMERIC,
nullptr);
15 throw std::exception(
"Failed to determine active locale settings for decimal separator.");
19 _oldLocale = std::string(local);
21 if (intendedDecimalSeparator ==
'.')
23 std::setlocale(LC_NUMERIC,
"en_US.UTF8");
25 else if(intendedDecimalSeparator ==
',')
27 std::setlocale(LC_NUMERIC,
"de_DE.UTF-8");
31 throw std::exception(
"Intended decimal separator is not supported.");