diff -r 05b3e173c900 -r 563a9b65777b src/basics.cpp --- a/src/basics.cpp Sat Mar 24 12:34:20 2018 +0200 +++ b/src/basics.cpp Sat Mar 24 12:46:40 2018 +0200 @@ -56,32 +56,19 @@ } -void roundToDecimals(double& value, int decimals) +double roundToDecimals(double value, int decimals) { if (decimals == 0) { - value = round(value); + return round(value); } else if (decimals > 0) { qreal coefficient = pow(10, decimals); - value = round(value * coefficient) / coefficient; + return round(value * coefficient) / coefficient; } } - -void applyToMatrix(Matrix& a, ApplyToMatrixFunction func) -{ - for (int i = 0; i < 9; ++i) - func(i, a.value(i)); -} - -void applyToMatrix(const Matrix& a, ApplyToMatrixConstFunction func) -{ - for (int i = 0; i < 9; ++i) - func(i, a.value(i)); -} - QString formatFileSize(qint64 size) { static const QString suffixes[] = {" bytes", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"};