diff --git a/src/corelib/tools/qlocale_mac.mm b/src/corelib/tools/qlocale_mac.mm index edbaaf5d18d..574cb0714cb 100644 --- a/src/corelib/tools/qlocale_mac.mm +++ b/src/corelib/tools/qlocale_mac.mm @@ -332,6 +332,17 @@ static QString macCurrencySymbol(QLocale::CurrencySymbolFormat format) return QString(); } +static QString macZeroDigit() +{ + QCFType locale = CFLocaleCopyCurrent(); + QCFType numberFormatter = + CFNumberFormatterCreate(nullptr, locale, kCFNumberFormatterNoStyle); + static const int zeroDigit = 0; + QCFType value = CFNumberFormatterCreateStringWithValue(nullptr, numberFormatter, + kCFNumberIntType, &zeroDigit); + return QString::fromCFString(value); +} + #ifndef QT_NO_SYSTEMLOCALE static QString macFormatCurrency(const QSystemLocale::CurrencyToStringArgument &arg) { @@ -437,8 +448,9 @@ static QVariant macQuoteString(QSystemLocale::QueryType type, const QStringRef & case NegativeSign: case PositiveSign: - case ZeroDigit: break; + case ZeroDigit: + return QVariant(macZeroDigit()); case MeasurementSystem: return QVariant(static_cast(macMeasurementSystem()));