Upgrade project to .NET 8

This commit is contained in:
Stone_Red
2023-12-14 19:00:47 +01:00
parent 9de227050a
commit 30ce61cc41
20 changed files with 53 additions and 137 deletions
@@ -1,9 +1,10 @@
namespace HyperbolicDownloaderApi.Utilities;
internal static class UnitFormatter
{
public static string TransferRate(long bytesPerSecond)
{
string[] ordinals = new[] { "", "K", "M", "G", "T", "P", "E" };
string[] ordinals = ["", "K", "M", "G", "T", "P", "E"];
decimal rate = bytesPerSecond * 8;
@@ -20,7 +21,7 @@ internal static class UnitFormatter
public static string FileSize(long bytes)
{
string[] ordinals = new[] { "", "K", "M", "G", "T", "P", "E" };
string[] ordinals = ["", "K", "M", "G", "T", "P", "E"];
decimal rate = bytes;
@@ -34,4 +35,4 @@ internal static class UnitFormatter
return $"{Math.Round(rate, 0, MidpointRounding.AwayFromZero)}{ordinals[ordinal]}B";
}
}
}