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

QLocale.toString() float format parameter not applied

XMLWordPrintable

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

      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

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes