mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-25 15:39:27 -05:00
Merge pull request #1734 from felisucoibi/master
aded PB PetaByte to filelists.
This commit is contained in:
commit
b830fe6602
@ -69,12 +69,12 @@ bool HashStorage::hashingProcessPaused()
|
||||
|
||||
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] ;
|
||||
|
||||
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)
|
||||
{
|
||||
sprintf(buf,"%2.2f",double(val)/fact) ;
|
||||
|
@ -38,8 +38,8 @@ 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)") };
|
||||
for(unsigned int i=0; i<5; ++i) {
|
||||
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<6; ++i) {
|
||||
if (val < 1024.) {
|
||||
return QString(QByteArray::number(val, 'f', 1)) + units[i];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user