Display correct(binary) unit prefixes in memory module (#2211)

This commit is contained in:
Michał Drozd
2020-11-27 23:30:09 +01:00
committed by GitHub
parent 5007dae35a
commit 0416093edc
4 changed files with 27 additions and 27 deletions

View File

@ -278,17 +278,17 @@ namespace string_util {
}
/**
* Create a MB filesize string
* Create a MiB filesize string
*/
string filesize_mb(unsigned long long kbytes, size_t precision, const string& locale) {
return floating_point(kbytes / 1024.0, precision, true, locale) + " MB";
string filesize_mib(unsigned long long kibibytes, size_t precision, const string& locale) {
return floating_point(kibibytes / 1024.0, precision, true, locale) + " MiB";
}
/**
* Create a GB filesize string
* Create a GiB filesize string
*/
string filesize_gb(unsigned long long kbytes, size_t precision, const string& locale) {
return floating_point(kbytes / 1024.0 / 1024.0, precision, true, locale) + " GB";
string filesize_gib(unsigned long long kibibytes, size_t precision, const string& locale) {
return floating_point(kibibytes / 1024.0 / 1024.0, precision, true, locale) + " GiB";
}
/**