diff --git a/src/gui/qgsadvanceddigitizingdockwidget.cpp b/src/gui/qgsadvanceddigitizingdockwidget.cpp index a4daf970bd9..b3b0d0988af 100644 --- a/src/gui/qgsadvanceddigitizingdockwidget.cpp +++ b/src/gui/qgsadvanceddigitizingdockwidget.cpp @@ -616,9 +616,23 @@ double QgsAdvancedDigitizingDockWidget::parseUserInput( const QString &inputValu QgsExpression expr( inputValue ); const QVariant result = expr.evaluate(); if ( expr.hasEvalError() ) + { ok = false; + // Be nice with non-dot locales + if ( QLocale().decimalPoint() != QChar( '.' ) && inputValue.contains( QLocale().decimalPoint() ) ) + { + QgsExpression exprC( QString( inputValue ).replace( QLocale().decimalPoint(), QChar( '.' ) ) ); + const QVariant resultC = exprC.evaluate(); + if ( ! exprC.hasEvalError() ) + { + value = resultC.toDouble( &ok ); + } + } + } else + { value = result.toDouble( &ok ); + } return value; } }