-3
如何在C#中將此循環表達爲數學表達式?如何以數學方式表示此功能
private string FormatBytes(long bytes)
{
string[] Suffix = { "B", "KB", "MB", "GB", "TB" };
int i;
double dblSByte = bytes;
for (i = 0; i < Suffix.Length && bytes >= 1024; i++, bytes /= 1024)
{
dblSByte = bytes/1024.0;
}
return String.Format("{0:0.##} {1}", dblSByte, Suffix[i]);
}
定義「數學」。 – CodeCaster
使用數學表達函數的結果 –
像這樣:https://puu.sh/xl6VX/155c777cdf.png –