System (LC_NUMERIC) decimal separator not honored

Issue #833 closed
Nicolas Goy created an issue

When using the fr_CH.UTF-8 value for LC_NUMERIC the decimal separator is set to , instead of ..

I double checked and my system is configured properly, the decimal separator is . in my locale:

env LC_NUMERIC=fr_CH.UTF-8 printf "%'.3f\n" 12345678.901 -> 12'345'678.901

If I start speedcrunch with the en_US.UTF-8 locale, I get the . separator, so speedcrunch is affected by LC_NUMERIC somehow.

I can workaround by overriding the decimal separator in the menu (as per https://bitbucket.org/heldercorreia/speedcrunch/issues/827/comma-decimal-separator ).

Using v0.12

Comments (6)

  1. Nicolas Goy reporter

    Yeah that's wrong, it should be a dot. But that's weird because speedcrunch is the only qt app showing this bug. I'll try to make a bug report upstream.

  2. Felix Krull

    It's weird that other Qt apps behave differently. I ran some more experiments; Fedora 28, Qt 5.10, both Qt and Speedcrunch from the normal repositories:

    [vagrant@fedora28 ~]$ LC_NUMERIC=de_DE python3 -c "from PyQt5.QtCore import QLocale; print(QLocale().decimalPoint())"
    ,
    [vagrant@fedora28 ~]$ LC_NUMERIC=en_GB python3 -c "from PyQt5.QtCore import QLocale; print(QLocale().decimalPoint())"
    .
    [vagrant@fedora28 ~]$ LC_NUMERIC=de_CH python3 -c "from PyQt5.QtCore import QLocale; print(QLocale().decimalPoint())"
    .
    [vagrant@fedora28 ~]$ LC_NUMERIC=fr_CH python3 -c "from PyQt5.QtCore import QLocale; print(QLocale().decimalPoint())"
    ,
    

    Qt evidently honours LC_NUMERIC in some fashion; it's just of the opinion that fr_CH uses , (but de_CH is .) so there's probably some data error somewhere. If I run Speedcrunch with LC_NUMERIC and decimal separator set to System Default, it uses the same character. So I think this is conclusively a bug in Qt (or their underlying locale data).

  3. Nicolas Goy reporter

    Just for reference, I realized the bug was introduced with qt5

    LC_NUMERIC=fr_CH python3 -c "from PyQt4.QtCore import QLocale; print(QLocale().decimalPoint())" 
    .
    

    That's why the other qt app I was using were not showing this bug, they use qt4.

  4. Log in to comment