use en_US locale instead of user's, fallback to C if not found

most likely every windows install has en_US available, even if in other
languages. if not, bring back the insertcommas function from history, no
biggie
This commit is contained in:
Marco Antonio J. Costa
2025-10-11 09:02:11 -03:00
committed by majcosta
parent 584f6b47e6
commit 332b267ae6
+6 -1
View File
@@ -9,7 +9,12 @@ auto FormatMoney(INT32 iNumber) -> std::wstring
{
static std::wstringstream wss([] {
std::wstringstream ss;
ss.imbue(std::locale(""));
try {
ss.imbue(std::locale("en_US.UTF-8"));
}
catch (const std::exception&) {
ss.imbue(std::locale::classic());
}
return ss;
}());
wss.str(L"");