Ich frage mich nur, ob .NET eine saubere Möglichkeit bietet, dies zu tun: < /p>
int64 x = 1000000;
string y = null;
if (x / 1024 == 0) {
y = x + " bytes";
}
else if (x / (1024 * 1024) == 0) {
y = string.Format("{0:n1} KB", x / 1024f);
}
< /code>
etc...
Bietet .NET einen einfachen Weg, um Bytes in KB, MB, GB usw. zu konvertieren? ⇐ C#
-
- Similar Topics
- Replies
- Views
- Last post
Mobile version