From c1fad34755ccf07663f0d962be5f207491eb244a Mon Sep 17 00:00:00 2001 From: Kyle Katarn Date: Sun, 10 May 2020 08:34:35 +0200 Subject: [PATCH] [WINNLS] Fix of GetCurrencyFormatW to handle "32" grouping format (#2719) --- dll/win32/kernel32/winnls/string/lcformat.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dll/win32/kernel32/winnls/string/lcformat.c b/dll/win32/kernel32/winnls/string/lcformat.c index 441c41b2211..5e5b529df9e 100644 --- a/dll/win32/kernel32/winnls/string/lcformat.c +++ b/dll/win32/kernel32/winnls/string/lcformat.c @@ -1762,7 +1762,7 @@ INT WINAPI GetCurrencyFormatW(LCID lcid, DWORD dwFlags, *szOut-- = *lpszDec--; /* Write decimal separator */ } - dwGroupCount = lpFormat->Grouping; + dwGroupCount = lpFormat->Grouping == 32 ? 3 : lpFormat->Grouping; /* Write the remaining whole number digits, including grouping chars */ while (szSrc >= lpszValue && *szSrc >= '0' && *szSrc <= '9') @@ -1791,6 +1791,8 @@ INT WINAPI GetCurrencyFormatW(LCID lcid, DWORD dwFlags, *szOut-- = *lpszGrp--; /* Write grouping char */ dwCurrentGroupCount = 0; + if (lpFormat->Grouping == 32) + dwGroupCount = 2; /* Indic grouping: 3 then 2 */ } } if (dwState & NF_ROUND)