This commit is contained in:
2022-05-26 19:24:18 +03:00
parent 363c85d0b3
commit 16c06c8319
13 changed files with 160 additions and 70 deletions

View File

@@ -62,5 +62,8 @@ namespace PluginManager.Online.Helpers
return await client.GetStringAsync(url);
}
}
}
}

View File

@@ -82,5 +82,6 @@ namespace PluginManager.Online
}
}
}

View File

@@ -274,5 +274,15 @@ namespace PluginManager.Others
}
}
}
public static (double, string) ConvertBytes(long bytes)
{
if (bytes < 1024) return (bytes, "B");
if (bytes < 1024 * 1024) return (bytes / 1024.0, "KB");
if (bytes < 1024 * 1024 * 1024) return (bytes / 1024.0 / 1024.0, "MB");
return (bytes / 1024.0 / 1024.0 / 1024.0, "GB");
}
}
}