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 2e340dd commit 36dffcb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/model/Model_Currency.cpp
Expand Up @@ -177,7 +177,15 @@ const wxString Model_Currency::toString(double value, const Data* currency, int
static wxString locale;

if (locale.empty())
{
locale = Model_Infotable::instance().GetStringInfo("LOCALE", "");
try {
fmt::format(std::locale(locale.c_str()), "{:L}", 123);
}
catch (...) {
locale = "";
}
}

static wxString use_locale;
if (use_locale.empty()) {
Expand Down

0 comments on commit 36dffcb

Please sign in to comment.