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

QLocale.toCurrencyString() omits decimals

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 6.4.1
    • PySide
    • None
    • Python 3.9
      PySide6 6.4.1
      Windows 10
    • Windows
    • 52e3b960b3 (pyside/pyside-setup/dev) 99ff428b81 (pyside/pyside-setup/6.4) 99ff428b81 (pyside/tqtc-pyside-setup/6.4) 52e3b960b3 (pyside/tqtc-pyside-setup/dev) e684f7e0ee (pyside/tqtc-pyside-setup/6.2), 02e488c61 (dev)

    Description

      from PySide6 import QtCore
      
      print(QtCore.QLocale("en_US").toCurrencyString(1234.56))
      

      This prints "$1,234", omitting the decimal digits.

      In Qt 6.4.1 (c++) this works as expected:

      #include <QLocale>
      
      int main(int argc, char *argv[])
      {
          qDebug() << QLocale("en_US").toCurrencyString(1234.56);
      }
      

      This prints "$1,234.56".

      Attachments

        Issue Links

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

          Activity

            People

              kleint Friedemann Kleint
              svadi Benjamin Boldt
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: