mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-23 16:58:06 -06:00
Improved user friendlyness of size units (Use 1KiB/s instead of 1024B/s)
Optimized transfer list repainting
This commit is contained in:
@@ -364,7 +364,7 @@ public:
|
||||
return tr("Unknown", "Unknown (size)");
|
||||
const QString units[5] = {tr("B", "bytes"), tr("KiB", "kibibytes (1024 bytes)"), tr("MiB", "mebibytes (1024 kibibytes)"), tr("GiB", "gibibytes (1024 mibibytes)"), tr("TiB", "tebibytes (1024 gibibytes)")};
|
||||
char i = 0;
|
||||
while(val > 1024. && i++<6)
|
||||
while(val >= 1024. && i++<6)
|
||||
val /= 1024.;
|
||||
return QString(QByteArray::number(val, 'f', 1)) + " " + units[(int)i];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user