qgsRound: places should be of integer type instead of double

This commit is contained in:
lbartoletti 2019-01-30 08:08:05 +01:00 committed by Nyall Dawson
parent e948120b7b
commit b4d01e461f
2 changed files with 2 additions and 2 deletions

View File

@ -123,7 +123,7 @@ bool qgsDoubleNearSig( double a, double b, int significantDigits = 10 );
Compare two doubles using specified number of significant digits
%End
double qgsRound( double number, double places );
double qgsRound( double number, int places );
%Docstring
Returns a double ``number``, rounded (as close as possible) to the specified number of ``places``.

View File

@ -301,7 +301,7 @@ inline bool qgsDoubleNearSig( double a, double b, int significantDigits = 10 )
*
* \since QGIS 3.0
*/
inline double qgsRound( double number, double places )
inline double qgsRound( double number, int places )
{
double m = ( number < 0.0 ) ? -1.0 : 1.0;
double scaleFactor = std::pow( 10.0, places );