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

QLocale.toString() issues

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2: Important P2: Important
    • None
    • 6.4.1
    • Core: Locales (i18n)
    • None

      Hi,

      I am having some issues using toString function from QLocale since I moved from PyQt5. My locale country is Spain, in case it matters for some region options. For trying to reproduce the following cases you can create a locale object first from QtCore.

       

      Negative numbers support:

      locale.toString(-4)  --> OverflowError. As is an integer number it should detect it and convert it, as is supported in the API

       

      Wrong decimal separator representation:

      locale.toString(1234)   --> 1234    (thousand separator is missing)

      locale.toString(12345) --> 12.345 (thousand separator is correct)

      locale.toString(float(3355443), 'f', 3) --> 3355.443,000 (thousand separator is missing)

       

      Supported signatures:

      When you get a TypeError exception a supported signatures option list appears. As it seems that the argument must be the right/excepted type when you could each function, it would be nice to get the different overload functions in the description as in the documented API.

       

      This is the API documentation for QLocale.toString() function.

      https://doc.qt.io/qtforpython/PySide6/QtCore/QLocale.html#PySide6.QtCore.PySide6.QtCore.QLocale.toString

       

      Thanks for your help.

      Iván

        1. image-2022-12-27-11-35-38-533.png
          25 kB
          Ivan Gonzalez
        2. image-2023-01-09-10-26-28-426.png
          34 kB
          Ivan Gonzalez
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Eddy Edward Welbourne
            igc-dev Ivan Gonzalez
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes