Skip to content

Commit

Permalink
Spin box: fix input of double values in locales with non-point decima…
Browse files Browse the repository at this point in the history
…l separator
  • Loading branch information
wonder-sk committed Oct 16, 2017
1 parent 54f8825 commit c176a8b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/expression/qgsexpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,9 @@ double QgsExpression::evaluateToDouble( const QString &text, const double fallba
{
bool ok;
//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 )
{
return convertedValue;
Expand Down

0 comments on commit c176a8b

Please sign in to comment.