use "0 B" instead of 0 for empty files
This commit is contained in:
parent
5633bfcbc2
commit
232ffdd7d4
|
@ -69,7 +69,7 @@ public class ItemsAdapter extends BaseAdapter {
|
|||
private String getFormattedSize(FileDirItem item) {
|
||||
final long size = item.getSize();
|
||||
if (size <= 0)
|
||||
return "0";
|
||||
return "0 B";
|
||||
final String[] units = {"B", "kB", "MB", "GB", "TB"};
|
||||
final int digitGroups = (int) (Math.log10(size) / Math.log10(1024));
|
||||
return new DecimalFormat("#,##0.#").format(size / Math.pow(1024, digitGroups)) + " " + units[digitGroups];
|
||||
|
|
Loading…
Reference in New Issue