by Anonymous » 10 Apr 2025, 12:12
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...
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...