Update units of memory from decimal to binary prefixes (#3716)

`MB` and `GB` can either be interpreted as having base-10 units, or
base-2. `MiB` and `GiB` removes this discrepancy so that units of memory
are always interpreted using base-2 units.
This commit is contained in:
Wunk
2022-11-16 14:27:42 -08:00
committed by GitHub
parent d751da84f9
commit d536cc8ae6
37 changed files with 165 additions and 165 deletions

View File

@ -10,22 +10,22 @@ namespace Ryujinx.Ava.Ui.Models
string aValue = (x as ApplicationData).TimePlayed;
string bValue = (y as ApplicationData).TimePlayed;
if (aValue[^2..] == "GB")
if (aValue[^3..] == "GiB")
{
aValue = (float.Parse(aValue[0..^2]) * 1024).ToString();
aValue = (float.Parse(aValue[0..^3]) * 1024).ToString();
}
else
{
aValue = aValue[0..^2];
aValue = aValue[0..^3];
}
if (bValue[^2..] == "GB")
if (bValue[^3..] == "GiB")
{
bValue = (float.Parse(bValue[0..^2]) * 1024).ToString();
bValue = (float.Parse(bValue[0..^3]) * 1024).ToString();
}
else
{
bValue = bValue[0..^2];
bValue = bValue[0..^3];
}
if (float.Parse(aValue) > float.Parse(bValue))