Details
-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
None
Description
reactos-bootcd-0.4.15-dev-142-gc276681-x86-gcc-lin-dbg
Regional Settings : number digits separator fails for 3;2;0 for currency
Should display following formats : {L"0;0", L"3;0", L"3;2;0"} like in Windows, as per dll/cpl/intl/currency.c but GetCurrencyFormatW returns the same formatted string for both "0.0" and "3;2;0". "32" grouping format is not correctly interpreted (or set)
/dll/cpl/intl/generalp.h:
GROUPINGDATA
|
GroupingFormats[MAX_GROUPINGFORMATS] =
|
{
|
{0, L"0;0"}, |
{3, L"3;0"}, |
{32, L"3;2;0"} |
};
|
Problem located in GetCurrencyFormatW implementation where lpFormat->Grouping is only considered as a "constant" numeric grouping value (2, 3, ...) but does not support "multidigits" like 32 in order to respect lpDecimalSep definition in MSDN ( https://docs.microsoft.com/fr-fr/windows/win32/api/winnls/ns-winnls-currencyfmta ) and use case of currency grouping with parameter set to 32.
dwGroupCount = lpFormat->Grouping; /* Write the remaining whole number digits, including grouping chars */ |
while (szSrc >= lpszValue && *szSrc >= '0' && *szSrc <= '9') |
{
|
if (dwState & NF_ROUND) |
{
|
if (*szSrc == '9') |
*szOut-- = '0'; /* continue rounding */ |
else |
{
|
dwState &= ~NF_ROUND;
|
*szOut-- = (*szSrc)+1; |
}
|
szSrc--;
|
}
|
else |
*szOut-- = *szSrc--; dwState |= NF_DIGITS_OUT;
|
dwCurrentGroupCount++;
|
if (szSrc >= lpszValue && dwCurrentGroupCount == dwGroupCount && *szSrc != '-') |
{
|
LPWSTR lpszGrp = lpFormat->lpThousandSep + strlenW(lpFormat->lpThousandSep) - 1; while (lpszGrp >= lpFormat->lpThousandSep) |
*szOut-- = *lpszGrp--; /* Write grouping char */ dwCurrentGroupCount = 0; |
}
|
}
|
where the culprit part of code is
dwCurrentGroupCount == dwGroupCount
|
which does not respect "The most significant grouping digit indicates the number of digits in the least significant group immediately to the left of the decimal separator"
This should be implemented in a similar way to GetNumberFormatW which supports format "32" in a specific way