Fri, 30 Mar 2018 14:30:51 +0300
fix warnings
src/basics.cpp | file | annotate | diff | comparison | revisions | |
src/primitives.cpp | file | annotate | diff | comparison | revisions |
--- a/src/basics.cpp Thu Mar 29 10:42:45 2018 +0300 +++ b/src/basics.cpp Fri Mar 30 14:30:51 2018 +0300 @@ -57,11 +57,13 @@ double roundToDecimals(double value, int decimals) { + decimals = max(0, decimals); + if (decimals == 0) { return round(value); } - else if (decimals > 0) + else { qreal coefficient = pow(10, decimals); return round(value * coefficient) / coefficient;