mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Spin box: fix input of double values in locales with non-point decimal separator
This commit is contained in:
parent
54f8825350
commit
c176a8bfb0
@ -471,7 +471,9 @@ double QgsExpression::evaluateToDouble( const QString &text, const double fallba
|
|||||||
{
|
{
|
||||||
bool ok;
|
bool ok;
|
||||||
//first test if text is directly convertible to double
|
//first test if text is directly convertible to double
|
||||||
double convertedValue = text.toDouble( &ok );
|
// use system locale: e.g. in German locale, user is presented with numbers "1,23" instead of "1.23" in C locale
|
||||||
|
// so we also want to allow user to rewrite it to "5,23" and it is still accepted
|
||||||
|
double convertedValue = QLocale::system().toDouble( text, &ok );
|
||||||
if ( ok )
|
if ( ok )
|
||||||
{
|
{
|
||||||
return convertedValue;
|
return convertedValue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user