mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
DolphinQt: Stub Host_* functions & Resource system.
This commit is contained in:
21
Source/Core/DolphinQt/Utils/Utils.cpp
Normal file
21
Source/Core/DolphinQt/Utils/Utils.cpp
Normal file
@ -0,0 +1,21 @@
|
||||
// Copyright 2014 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <QStringListIterator>
|
||||
|
||||
#include "Utils.h"
|
||||
|
||||
QString NiceSizeFormat(s64 size)
|
||||
{
|
||||
QStringList list = { SL("KB"), SL("MB"), SL("GB"), SL("TB"), SL("PB"), SL("EB") };
|
||||
QStringListIterator i(list);
|
||||
QString unit = SL("b");
|
||||
double num = size;
|
||||
while (num >= 1024.0 && i.hasNext())
|
||||
{
|
||||
unit = i.next();
|
||||
num /= 1024.0;
|
||||
}
|
||||
return SL("%1 %2").arg(QString::number(num, 'f', 1)).arg(unit);
|
||||
}
|
Reference in New Issue
Block a user