Update misc.cpp

This commit is contained in:
felisucoibi 2019-12-01 12:28:07 +01:00 committed by GitHub
parent 7ed186fdf8
commit 2340c8ff20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,7 +38,7 @@ QString misc::friendlyUnit(float val)
if(val < 0) {
return tr("Unknown", "Unknown (size)");
}
const QString units[5] = {tr(" B", "bytes"), tr(" KB", "kilobytes (1024 bytes)"), tr(" MB", "megabytes (1024 kilobytes)"), tr(" GB", "gigabytes (1024 megabytes)"), tr(" TB", "terabytes (1024 gigabytes)") };
const QString units[6] = {tr(" B", "bytes"), tr(" KB", "kilobytes (1024 bytes)"), tr(" MB", "megabytes (1024 kilobytes)"), tr(" GB", "gigabytes (1024 megabytes)"), tr(" TB", "terabytes (1024 gigabytes)"), tr(" PB", "petabytes (1024 terabytes)") };
for(unsigned int i=0; i<5; ++i) {
if (val < 1024.) {
return QString(QByteArray::number(val, 'f', 1)) + units[i];