* Moved the duplicate "string_for_size()" implementations into libshared.a.
* Adapted libtracker.so, DriveSetup and Installer to use the shared version. * The new version uses the correct units (KiB instead of KB and so on). * Use the correct units in a few other prominent places, where string_for_size() could not be used. Should resolve a major part of #5378. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35935 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -675,11 +675,11 @@ BInfoWindow::GetSizeString(BString &result, off_t size, int32 fileCount)
|
||||
bytes = numStr;
|
||||
|
||||
if (size >= kGBSize)
|
||||
PrintFloat(result, (float)size / kGBSize) << " GB";
|
||||
PrintFloat(result, (float)size / kGBSize) << " GiB";
|
||||
else if (size >= kMBSize)
|
||||
PrintFloat(result, (float)size / kMBSize) << " MB";
|
||||
PrintFloat(result, (float)size / kMBSize) << " MiB";
|
||||
else if (size >= kKBSize)
|
||||
result << (int64)(size + kHalfKBSize) / kKBSize << "K";
|
||||
result << (int64)(size + kHalfKBSize) / kKBSize << "KiB";
|
||||
else
|
||||
result << size;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user