mirror of
https://github.com/qgis/QGIS.git
synced 2025-12-30 00:29:39 -05:00
parent
2d2cd13c58
commit
db10e7d4ec
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user