mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
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:
committed by
majcosta
parent
584f6b47e6
commit
332b267ae6
@@ -9,7 +9,12 @@ auto FormatMoney(INT32 iNumber) -> std::wstring
|
|||||||
{
|
{
|
||||||
static std::wstringstream wss([] {
|
static std::wstringstream wss([] {
|
||||||
std::wstringstream ss;
|
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;
|
return ss;
|
||||||
}());
|
}());
|
||||||
wss.str(L"");
|
wss.str(L"");
|
||||||
|
|||||||
Reference in New Issue
Block a user