[PyQt] Decimal separator Problem
info at linos.es
Tue Nov 13 22:43:29 GMT 2007
Ok, the real problem here it is that i cant use the dot in the numpad to begin decimal numbers, i have checked
and spanish locale use comma like decimal separator, i was confused by too many english software i use, but i
have checked and in almost all the software i can use the dot in numpad to begin decimal numbers (although i
view a comma), anyone knows how to map the symbol or other way to do that?
> i have a problem with the decimal separator in float numbers, i detect the problem in a QDoubleSpinBox (the
> decimal separator should be "." but it is ",") and i think it is failing in other objects. My locale in
> "es_ES", if i use "locale" command in bash i get this:
> i have added this code to the __init__ of a dialog.
> print QString("%L1").arg(10.54)
> locale = QLocale()
> country = locale.country()
> language = locale.language()
> print locale.countryToString(country)
> print locale.languageToString(language)
> print QString("10,25").toDouble()
> and i get this output:
> The first localized arg isnt good and the last toDouble it is good printed because python convert it to a
> float and python dont have the problem with the locale. The strange about this it is i have the same problem
> if i exec in a windows machine, what can be the problem?
> Best Regards,
> Miguel Angel.
> PyQt mailing list PyQt at riverbankcomputing.com
More information about the PyQt