mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
DolphinQt: Make block size configurable in convert dialog
This commit is contained in:
@ -453,7 +453,7 @@ void EnableScreenSaver(bool enable)
|
||||
#endif
|
||||
}
|
||||
|
||||
std::string FormatSize(u64 bytes)
|
||||
std::string FormatSize(u64 bytes, int decimals)
|
||||
{
|
||||
// i18n: The symbol for the unit "bytes"
|
||||
const char* const unit_symbols[] = {_trans("B"), _trans("KiB"), _trans("MiB"), _trans("GiB"),
|
||||
@ -468,7 +468,7 @@ std::string FormatSize(u64 bytes)
|
||||
// Don't need exact values, only 5 most significant digits
|
||||
const double unit_size = std::pow(2, unit * 10);
|
||||
std::ostringstream ss;
|
||||
ss << std::fixed << std::setprecision(2);
|
||||
ss << std::fixed << std::setprecision(decimals);
|
||||
ss << bytes / unit_size << ' ' << Common::GetStringT(unit_symbols[unit]);
|
||||
return ss.str();
|
||||
}
|
||||
|
Reference in New Issue
Block a user