https://bugs.kde.org/show_bug.cgi?id=406388

Cesar Garcia <cesa...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|1                           |0
             Status|NEEDSINFO                   |REPORTED
         Resolution|WAITINGFORINFO              |---

--- Comment #13 from Cesar Garcia <cesa...@gmail.com> ---
I have made more tests and seems that the bug is in Qt. I switched my locale to
Colombia (also uses the comma as decimal separator) and Krunner works  as
expected. The system locale seems OK (added en_US as control)

$ LC_ALL=en_US.UTF-8 locale -kc LC_NUMERIC 
LC_NUMERIC
decimal_point="."
thousands_sep=","
grouping=3;3
numeric-decimal-point-wc=46
numeric-thousands-sep-wc=44
numeric-codeset="UTF-8"

$ LC_ALL=es_PE.UTF-8 locale -kc LC_NUMERIC
LC_NUMERIC
decimal_point=","
thousands_sep="."
grouping=3;3
numeric-decimal-point-wc=44
numeric-thousands-sep-wc=46
numeric-codeset="UTF-8"

$ LC_ALL=es_CO.UTF-8 locale -kc LC_NUMERIC
LC_NUMERIC
decimal_point=","
thousands_sep="."
grouping=3;3
numeric-decimal-point-wc=44
numeric-thousands-sep-wc=46
numeric-codeset="UTF-8"

Then made a simple Qt app to check the number formatting of Colombia and PerĂº
(should be the same)

#include <QCoreApplication>
#include <QDebug>
#include <QLocale>

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    double number = 2565.25;

    QLocale peLocale(QLocale::Spanish, QLocale::Peru);
    QString ss = peLocale.toString(number);
    auto point = peLocale.decimalPoint();
    qDebug() << "PE Separator:" << point;
    qDebug()<<"PE formatted number: " << ss;

    QLocale coLocale(QLocale::Spanish, QLocale::Colombia);
    ss = coLocale.toString(number);
    point = coLocale.decimalPoint();
    qDebug() << "CO Separator:" << point;
    qDebug()<<"CO formatted number: " << ss;
    return 0;
}

But the results were different:

PE Separator: '.'
PE formatted number:  "2,565.25"
CO Separator: ','
CO formatted number:  "2.565,25"

I am gonna open a bug report with Qt and use es_CO for the KDE number format
settings as a workaround until the bug is resolved.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to