Ref T125, human readable file size

This commit is contained in:
Klaus Basan
2017-08-15 02:11:22 +02:00
committed by Mathew Sutcliffe
parent 8c032fb4d7
commit 53189eafd5
4 changed files with 36 additions and 5 deletions

View File

@@ -51,6 +51,11 @@ namespace BlackMisc
return rv;
}
QString CMathUtils::roundAsString(double value, int digits)
{
return QString::number(round(value, digits));
}
double CMathUtils::roundEpsilon(double value, double epsilon)
{
if (epsilon == 0) { return value; } // avoid division by 0

View File

@@ -50,6 +50,9 @@ namespace BlackMisc
//! Utility round method
static double round(double value, int digits);
//! Utility round method, returning as string
static QString roundAsString(double value, int digits);
//! Round by given epsilon
static double roundEpsilon(double value, double epsilon);