Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-81050

Do number-formatting correctly

XMLWordPrintable

    • Icon: User Story User Story
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 6.0.0
    • None
    • Core: Locales (i18n)
    • All
    • 13
    • Qt6_Foundation_ Sprint 11, Qt6_Foundation_ Sprint 13
    • bb6a73260ec8272647265f42180963604ad0f755 3f8eae848e5cf80b45d226ad3ca07664df0f55c6

      The placement of grouping characters in the whole-number portion of a number is currently done wrong. For (only) Indian, we special-case a group of the three least-significant digits with successive groups of two to the left of it; for everything else, it's all three-digit groups. The CLDR contains data that properly describes the correct placement of digits, with one size for the least-significant group and another for all more significant groups. We need to capture that data from CLDR for inclusion in our locale data and adapt the code to use it correctly.

      This shall involve discarding the Indian-numbering-specific implementation; at the same time, the separator should be renamed from "thousands" separator.
      Fortunately, "thousands" isn't used in the QLocale API: QLocale::NumberOption already uses the name "grouping separator", so we can reuse that.
      QLocaleData::Flags needs its ThousandsGrouping renamed to GroupDigits.

      The decimal separator and grouping "characters" also need to become QString (as they already are in QSystemLocale::query(QSystemLocale::QueryType, QVariant)), since they may be surrogate pairs in some numbering systems – see QTBUG-69324.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Eddy Edward Welbourne
            Eddy Edward Welbourne
            Maurice Kalinowski Maurice Kalinowski
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 2 weeks
                2w
                Remaining:
                Remaining Estimate - 2 weeks
                2w
                Logged:
                Time Spent - Not Specified
                Not Specified

                  There are no open Gerrit changes