Skip to content

Commit

Permalink
fix(moneymanagerex#3587): test locale before use
Browse files Browse the repository at this point in the history
  • Loading branch information
vomikan committed Jun 9, 2021
1 parent 36dffcb commit c506256
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/model/Model_Currency.cpp
Expand Up @@ -176,19 +176,18 @@ const wxString Model_Currency::toString(double value, const Data* currency, int
static wxString decimal;
static wxString locale;

if (locale.empty())
{
if (locale.empty()) {
locale = Model_Infotable::instance().GetStringInfo("LOCALE", "");
}

static wxString use_locale;
if (use_locale.empty()) {
try {
fmt::format(std::locale(locale.c_str()), "{:L}", 123);
}
catch (...) {
locale = "";
}
}

static wxString use_locale;
if (use_locale.empty()) {
use_locale = locale.empty() ? "N" : "Y";
}

Expand Down

0 comments on commit c506256

Please sign in to comment.