diff options
author | wodry <wodry@users.noreply.github.com> | 2021-03-15 15:14:54 +0100 |
---|---|---|
committer | wodry <wodry@users.noreply.github.com> | 2021-03-19 19:35:42 +0100 |
commit | d09ebc47233187ab8dd5a70df4d261353958978c (patch) | |
tree | aef27d4eadd68309d543d12de59eb462a5440002 /src/qt/guiutil.cpp | |
parent | eceb3f7707d6793152a00476adae1c4e268ce6f3 (diff) |
Fix wrong(1024) divisor for 1000-based prefixes
Diffstat (limited to 'src/qt/guiutil.cpp')
-rw-r--r-- | src/qt/guiutil.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 32890ed0fe..b4afdbcc22 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -759,14 +759,14 @@ QString formatNiceTimeOffset(qint64 secs) QString formatBytes(uint64_t bytes) { - if(bytes < 1024) + if (bytes < 1'000) return QObject::tr("%1 B").arg(bytes); - if(bytes < 1024 * 1024) - return QObject::tr("%1 KB").arg(bytes / 1024); - if(bytes < 1024 * 1024 * 1024) - return QObject::tr("%1 MB").arg(bytes / 1024 / 1024); + if (bytes < 1'000'000) + return QObject::tr("%1 kB").arg(bytes / 1'000); + if (bytes < 1'000'000'000) + return QObject::tr("%1 MB").arg(bytes / 1'000'000); - return QObject::tr("%1 GB").arg(bytes / 1024 / 1024 / 1024); + return QObject::tr("%1 GB").arg(bytes / 1'000'000'000); } qreal calculateIdealFontSize(int width, const QString& text, QFont font, qreal minPointSize, qreal font_size) { |