mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-29 22:20:48 +00:00
Report filesizes on macOS as decimal multiples
i.e. multiples of 1000
This commit is contained in:
parent
a8bfa6a16c
commit
3a16b2e92c
@ -625,13 +625,18 @@ namespace gui
|
|||||||
{
|
{
|
||||||
usz byte_unit = 0;
|
usz byte_unit = 0;
|
||||||
usz divisor = 1;
|
usz divisor = 1;
|
||||||
|
#if defined(__APPLE__)
|
||||||
|
usz multiplier = 1000;
|
||||||
|
#else
|
||||||
|
usz multiplier = 1024;
|
||||||
|
#endif
|
||||||
|
|
||||||
static const QString s_units[]{"B", "KB", "MB", "GB", "TB", "PB"};
|
static const QString s_units[]{"B", "KB", "MB", "GB", "TB", "PB"};
|
||||||
|
|
||||||
while (byte_unit < std::size(s_units) - 1 && size / divisor >= 1024)
|
while (byte_unit < std::size(s_units) - 1 && size / divisor >= multiplier)
|
||||||
{
|
{
|
||||||
byte_unit++;
|
byte_unit++;
|
||||||
divisor *= 1024;
|
divisor *= multiplier;
|
||||||
}
|
}
|
||||||
|
|
||||||
return QStringLiteral("%0 %1").arg(QString::number((size + 0.) / divisor, 'f', 2)).arg(s_units[byte_unit]);
|
return QStringLiteral("%0 %1").arg(QString::number((size + 0.) / divisor, 'f', 2)).arg(s_units[byte_unit]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user