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:
@ -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))
|
||||
|
Reference in New Issue
Block a user