256: Workspace explorer
Task-Url: https://support.d4science.org/issues/256 Added size 0 instead of Empty git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-explorer@117192 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
7b96c4083a
commit
c1b68dc72b
|
@ -14,7 +14,7 @@ public class StringUtil {
|
|||
|
||||
public static String readableFileSize(long size) {
|
||||
if(size < 0) return "Unknown";
|
||||
if(size == 0) return "Empty";
|
||||
if(size == 0) return "0";
|
||||
final String[] units = new String[] { "B", "KB", "MB", "GB", "TB" };
|
||||
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