Skip to content
Permalink
Browse files
Remove problematic curly brace initializations in QgsExpressionUtils …
…class
  • Loading branch information
nirvn committed Jul 17, 2021
1 parent 4a9c43d commit 79ae6db269037a7b5a881c54ca20aaca7049f82e
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/core/expression/qgsexpressionutils.h
@@ -466,10 +466,10 @@ class QgsExpressionUtils
else if ( value.type() == QVariant::Double || value.type() == static_cast<QVariant::Type>( QMetaType::Float ) )
{
bool ok;
const QString strVal { value.toString() };
const int dotPosition { strVal.indexOf( '.' ) };
const int precision { dotPosition > 0 ? strVal.length() - dotPosition - 1 : 0 };
const QString res { QLocale().toString( value.toDouble( &ok ), 'f', precision ) };
const QString strVal = value.toString();
const int dotPosition = strVal.indexOf( '.' );
const int precision = dotPosition > 0 ? strVal.length() - dotPosition - 1 : 0;
const QString res = QLocale().toString( value.toDouble( &ok ), 'f', precision );

if ( ok )
{

0 comments on commit 79ae6db

Please sign in to comment.