Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-3070

QLocale.toString() float format parameter not applied

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Not Evaluated
    • None
    • 6.8.2, 6.9.0
    • PySide
    • None

    Description

      Hi,

      The overloaded QLocale.toString function for floats does not apply the specified format parameter. This behavior seems to be independent of the QLocale region/language.

      Example:

      QLocale("en").toString(12.345, format="f", precision=2) >>  '12'   (expected outcome: '12.35')
      QLocale("de").toString(12.345, format="e", precision=2) >> '12'   (expected: '1,23E+01')
      

      It seems like the default format value "g" is always used.

      Thank you for your help!
      Georg

      Attachments

        Issue Links

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

          Activity

            People

              crmaurei Cristian Maureira-Fredes
              georgp Georg Poelchen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes