diff options
| author | Wunk <wunkolo@gmail.com> | 2022-11-16 14:27:42 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-16 23:27:42 +0100 |
| commit | d536cc8ae6d6725780365d858f2fd64b66d90b7f (patch) | |
| tree | ef0767a9bc808ba15967607b79a0e3e83924b30b /Ryujinx.Ava/Ui/Models/Generic/FileSizeSortComparer.cs | |
| parent | d751da84f941e0d089040cb7aad2c1b3224ae6b7 (diff) | |
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.
Diffstat (limited to 'Ryujinx.Ava/Ui/Models/Generic/FileSizeSortComparer.cs')
| -rw-r--r-- | Ryujinx.Ava/Ui/Models/Generic/FileSizeSortComparer.cs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Ryujinx.Ava/Ui/Models/Generic/FileSizeSortComparer.cs b/Ryujinx.Ava/Ui/Models/Generic/FileSizeSortComparer.cs index 17409835..08b1754c 100644 --- a/Ryujinx.Ava/Ui/Models/Generic/FileSizeSortComparer.cs +++ b/Ryujinx.Ava/Ui/Models/Generic/FileSizeSortComparer.cs @@ -15,22 +15,22 @@ namespace Ryujinx.Ava.Ui.Models.Generic string aValue = x.FileSize; string bValue = y.FileSize; - 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)) |
