mirror of
https://git.wownero.com/wowlet/wowlet.git
synced 2024-08-15 01:03:14 +00:00
Merge pull request 'Utils: improve bytes formatting' (#255) from tobtoht/feather:bytes_formatting into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/255
This commit is contained in:
commit
3b7731d44f
1 changed files with 2 additions and 2 deletions
|
@ -553,14 +553,14 @@ QString Utils::formatBytes(quint64 bytes)
|
|||
|
||||
int i;
|
||||
double _data;
|
||||
for (i = 0; i < sizes.count() && bytes >= 1000; i++, bytes /= 1000)
|
||||
for (i = 0; i < sizes.count() && bytes >= 10000; i++, bytes /= 1000)
|
||||
_data = bytes / 1000.0;
|
||||
|
||||
if (_data < 0)
|
||||
_data = 0;
|
||||
|
||||
// unrealistic
|
||||
if (_data > 1000)
|
||||
if (_data > 10000)
|
||||
_data = 0;
|
||||
|
||||
return QString("%1 %2").arg(QString::number(_data, 'f', 1), sizes[i]);
|
||||
|
|
Loading…
Reference in a new issue