Skip to content

Commit

Permalink
Remove problematic curly brace initializations in QgsExpressionUtils …
Browse files Browse the repository at this point in the history
…class
  • Loading branch information
nirvn committed Jul 17, 2021
1 parent 4a9c43d commit 79ae6db
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/expression/qgsexpressionutils.h
Expand Up @@ -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 )
{
Expand Down

0 comments on commit 79ae6db

Please sign in to comment.