mirror of
https://github.com/geode-sdk/geode.git
synced 2025-04-10 12:04:36 -04:00
Fix the failed to set locale on devices that don't have us english (like my phone) (#566)
This commit is contained in:
parent
0d64935a11
commit
6ee63091de
1 changed files with 1 additions and 1 deletions
|
@ -113,7 +113,7 @@ namespace geode {
|
|||
Num val;
|
||||
char* strEnd;
|
||||
errno = 0;
|
||||
if (std::setlocale(LC_NUMERIC, "en_US.utf8")) {
|
||||
if (std::setlocale(LC_NUMERIC, "C")) {
|
||||
if constexpr (std::is_same_v<Num, float>) val = std::strtof(str.data(), &strEnd);
|
||||
else if constexpr (std::is_same_v<Num, double>) val = std::strtod(str.data(), &strEnd);
|
||||
else if constexpr (std::is_same_v<Num, long double>) val = std::strtold(str.data(), &strEnd);
|
||||
|
|
Loading…
Add table
Reference in a new issue