MCPcopy Create free account
hub / github.com/FongMi/CatVodSpider / getSize

Method getSize

app/src/main/java/com/github/catvod/utils/Util.java:41–46  ·  view source on GitHub ↗
(double size)

Source from the content-addressed store, hash-verified

39 }
40
41 public static String getSize(double size) {
42 if (size <= 0) return "";
43 String[] units = new String[]{"bytes", "KB", "MB", "GB", "TB"};
44 int digitGroups = (int) (Math.log10(size) / Math.log10(1024));
45 return new DecimalFormat("#,##0.#").format(size / Math.pow(1024, digitGroups)) + " " + units[digitGroups];
46 }
47
48 public static String removeExt(String text) {
49 return text.contains(".") ? text.substring(0, text.lastIndexOf(".")) : text;

Callers 2

vodMethod · 0.95
getRemarkMethod · 0.95

Calls 1

formatMethod · 0.45

Tested by

no test coverage detected