Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-12800

Changing float display format not possible for localized float output

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Not Evaluated Not Evaluated
    • Qt Creator 4.0.0-beta1
    • Qt Creator 3.2.0-rc1
    • Debugger
    • None
    • Linux: reproduceable, (Windows: at least seen once)
    • 2a59bd65149078dd0f383d60240b9321efaf1a11

      GNU gdb (GDB) 7.6.1-ubuntu (and I think Microsoft CDB also, at least in some cases) prints floating point numbers with German locale (e.g. 1,234 instead of 1.234).

      Changing the watch format is therefore not possible.

      I see the following possibilities:
      1. call gdb with LANG=C so it outputs 1.234 (In a programming background, I would never expect localized floating point numbers)
      1.1 I'm not sure if this is possible for Microsoft CDB.
      2. rely on QString::toDouble() that should, regarding the docs try to convert localized floats too, however that does not work. Maybe Creator calls QLocale::setDefault somewhere? (I didn't found it).
      3. Use an ugly hack (I already have one but will only push to Gerrit if I'm forced to) and try to convert again with QLocale::toDouble() if QString::toDouble() returns not ok.

      Notes to 2 and 3:
      Reformated floating point numbers should use localized output also, for consistency.

        For Gerrit Dashboard: QTCREATORBUG-12800
        # Subject Branch Project Status CR V

            hjk hjk
            aha_1980 André Hartmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes