Skip to content
Permalink
Browse files
qgsDoubleToString: Don't remove trailing zeros when integer
Fix #12947

cherry-picked from ac38b21

Backported to 2.8.3
  • Loading branch information
m-kuhn committed Jun 12, 2015
1 parent cb8d336 commit 43569eff14b8430fc0173e0301ae0522ec7ade79
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/core/qgis.h
@@ -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 );
}

//

0 comments on commit 43569ef

Please sign in to comment.