Skip to content

Commit

Permalink
qgsDoubleToString: Don't remove trailing zeros when integer
Browse files Browse the repository at this point in the history
Fix #12947

cherry-picked from ac38b21

Backported to 2.8.3
  • Loading branch information
m-kuhn committed Jun 12, 2015
1 parent cb8d336 commit 43569ef
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/qgis.h
Expand Up @@ -318,7 +318,10 @@ inline void ( *cast_to_fptr( void *p ) )()
//
inline QString qgsDoubleToString( const double &a, const int &precision = 17 )
{
return QString::number( a, 'f', precision ).remove( QRegExp( "\\.?0+$" ) );
if ( precision )
return QString::number( a, 'f', precision ).remove( QRegExp( "\\.?0+$" ) );
else
return QString::number( a, 'f', precision );
}

//
Expand Down

0 comments on commit 43569ef

Please sign in to comment.