提交功能
This commit is contained in:
27
Utils.cs
Normal file
27
Utils.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
namespace ACBuildService;
|
||||
|
||||
public class Utils
|
||||
{
|
||||
public static string GetFileSizeTitle(long length)
|
||||
{
|
||||
if (length < 1024)
|
||||
{
|
||||
return length + "B";
|
||||
}
|
||||
|
||||
length /= 1024;
|
||||
|
||||
if (length < 1024)
|
||||
{
|
||||
return (length * 100 / 100) + "KB";
|
||||
}
|
||||
|
||||
length /= 1024;
|
||||
if (length < 1024)
|
||||
{
|
||||
return (length * 100 / 100.0f) + "MB";
|
||||
}
|
||||
|
||||
return ((length / 1024 * 100) / 100.0f) + "GB";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user