Fixed Volume sizes unit in info window, using string_for_size().
This fix #6395. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37764 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
c090a0fd84
commit
b599c219a3
@ -1546,16 +1546,11 @@ AttributeView::CheckAndSetSize()
|
||||
fFreeBytes = freeBytes;
|
||||
|
||||
char capacityStr[16], usedStr[16], freeStr[16];
|
||||
sprintf(usedStr, "%.1f", (float)(capacity - fFreeBytes) / kMBSize);
|
||||
sprintf(freeStr, "%.1f", (float)fFreeBytes / kMBSize);
|
||||
string_for_size(capacity, capacityStr, sizeof(capacityStr));
|
||||
string_for_size(capacity - fFreeBytes, usedStr, sizeof(usedStr));
|
||||
string_for_size(fFreeBytes, freeStr, sizeof(freeStr));
|
||||
|
||||
if (capacity >= kGBSize) {
|
||||
fSizeStr.SetTo(B_TRANSLATE("%capacity GB (%used MB used -- %free MB free)"));
|
||||
sprintf(capacityStr, "%.1f", (float)capacity / kGBSize);
|
||||
} else {
|
||||
fSizeStr.SetTo(B_TRANSLATE("%capacity MB (%used MB used -- %free MB free)"));
|
||||
sprintf(capacityStr, "%.1f", (float)capacity / kMBSize);
|
||||
}
|
||||
fSizeStr.SetTo(B_TRANSLATE("%capacity (%used used -- %free free)"));
|
||||
fSizeStr.ReplaceFirst("%capacity", capacityStr);
|
||||
fSizeStr.ReplaceFirst("%used", usedStr);
|
||||
fSizeStr.ReplaceFirst("%free", freeStr);
|
||||
|
Loading…
Reference in New Issue
Block a user