Merge pull request #1734 from felisucoibi/master

aded PB PetaByte to filelists.
This commit is contained in:
G10h4ck 2019-12-02 11:50:10 +01:00 committed by GitHub
commit b830fe6602
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -69,12 +69,12 @@ bool HashStorage::hashingProcessPaused()
static std::string friendlyUnit(uint64_t val) static std::string friendlyUnit(uint64_t val)
{ {
const std::string units[5] = {"B","KB","MB","GB","TB"}; const std::string units[6] = {"B","KB","MB","GB","TB","PB"};
char buf[50] ; char buf[50] ;
double fact = 1.0 ; double fact = 1.0 ;
for(unsigned int i=0; i<5; ++i) for(unsigned int i=0; i<6; ++i)
if(double(val)/fact < 1024.0) if(double(val)/fact < 1024.0)
{ {
sprintf(buf,"%2.2f",double(val)/fact) ; sprintf(buf,"%2.2f",double(val)/fact) ;

View File

@ -38,8 +38,8 @@ QString misc::friendlyUnit(float val)
if(val < 0) { if(val < 0) {
return tr("Unknown", "Unknown (size)"); 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) { for(unsigned int i=0; i<6; ++i) {
if (val < 1024.) { if (val < 1024.) {
return QString(QByteArray::number(val, 'f', 1)) + units[i]; return QString(QByteArray::number(val, 'f', 1)) + units[i];
} }