Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-69915

Support i18n number formatting with number groups for thousands

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.11, 4.0
    • Fix Version/s: None
    • Component/s: Language, Usability, UX
    • Affected Branches:
      MOODLE_311_STABLE, MOODLE_400_STABLE

      Description

      format_float() currently does not to any thousands grouping eg:

      1234567.89

      vs

      1,234,567.89

      https://github.com/moodle/moodle/blob/master/lib/moodlelib.php#L8782

       

      There is no reason it can't its just doing it properly and supporting all the funky languages that sometimes do 4 digits, or 2 digits, or sometimes 3 and then 2. php doesn't support this out of the box but it should not be that crazy to implement and would improve the UX / readability of many large numbers across many places.

      https://en.wikipedia.org/wiki/Decimal_separator#Digit_grouping

       

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              brendanheywood Brendan Heywood
              Participants:
              Component watchers:
              David Mudrák (@mudrd8mz), Helen Foster, Víctor Déniz Falcón, Barbara Ramiro, Bas Brands
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated: