Skip to content
Permalink
Browse files

qgsRound: places should be of integer type instead of double

(cherry picked from commit b4d01e4)
  • Loading branch information
lbartoletti authored and nyalldawson committed Feb 7, 2019
1 parent eb8e36c commit a249e28c04db5db2bd1e8db60cbc47362ebfe32d
Showing with 2 additions and 2 deletions.
  1. +1 −1 python/core/auto_generated/qgis.sip.in
  2. +1 −1 src/core/qgis.h
@@ -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``.

@@ -314,7 +314,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 );

0 comments on commit a249e28

Please sign in to comment.
You can’t perform that action at this time.