- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
QString calcFileSize( qint64 value )
{ //pay attention that for size<1M "" returned
QString sizeStr = "";
if (value > 99ll * 1000ll * 1000ll * 1000ll * 1000ll)
sizeStr = QString::number ((((value / 1000) / 1000) / 1000) / 1000) + QObject::tr (" TB");
else if (value > 99ll * 1000ll * 1000ll * 1000ll)
sizeStr = QString::number (((value / 1000) / 1000) / 1000) + QObject::tr (" GB");
else if (value > 99 * 1000 * 1000)
sizeStr = QString::number (((value / 1000) / 1000)) + QObject::tr (" MB");
else if (value > 99 * 1000)
sizeStr = QString::number ((value / 1000) ) + QObject::tr (" KB");
else
sizeStr = QString::number (value) + QObject::tr (" Bytes");
return sizeStr;
}
mrvlmor 27.01.2011 09:27 # 0
Dummy00001 27.01.2011 16:36 # 0
ан нет - можно.