mirror of
https://github.com/Stone-Red-Code/HyperbolicDownloader.git
synced 2026-09-07 15:56:24 +02:00
Upgrade project to .NET 8
This commit is contained in:
@@ -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";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user