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

Implement system query for digit grouping rules

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.0, 6.5.0 FF
    • Core: Locales (i18n)
    • None
    • All
    • 8
    • Foundation Sprint 117, Foundation Sprint 118, Foundation Sprint 119, Foundation Sprint 120

    Description

      Since Qt 6, QLocale has included the CLDR data governing how to group digits correctly (where previously it grouped them in threes). However, the user may have configured rules at odds with the locale they are otherwise using (for example, es_ES requires at least two digits in the most significant group but some users prefer to allow a single-digit first group, as in many other locales). So we need a QSystemLocale::QueryType for the grouping rule, GroupingRule, for which we'll need to package three numbers into the return type; QLocaleData packs them into a single byte as two bits for the minimum size of most significant group, three bits each for the sizes of the least significant and all groups in between.

      Given that CLDR has potentially separate grouping rules for currency digits, it'll probably make sense to add a

      struct { int least, higher, top; }

      that gets constructed out of the packed bits in QLocaleData or the return from QSystemLocale::query(); this implies an opportunity to possibly amend the bit-field to use some more tightly-packed form (e.g. all three fields are necessarily > 0, so storing the bit-field values with 1 subtracted from each would make two bits suffice for each, if they don't already).

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-109955
          # Subject Branch Project Status CR V

          Activity

            People

              eimen_oues Eimen Oueslati
              Eddy Edward Welbourne
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There is 1 open Gerrit change