Update StringUtil.java
Added TB
This commit is contained in:
committed by
Andrew DeMaria
parent
762ce0ad52
commit
30bc5a90f5
@@ -212,6 +212,12 @@ public final class StringUtil {
|
|||||||
*/
|
*/
|
||||||
public static synchronized String formatBytes(long byteCount, Locale locale) {
|
public static synchronized String formatBytes(long byteCount, Locale locale) {
|
||||||
|
|
||||||
|
// More than 1 TB?
|
||||||
|
if (byteCount >= 1024 * 1024 * 1024 * 1024) {
|
||||||
|
NumberFormat teraByteFormat = new DecimalFormat("0.00 TB", new DecimalFormatSymbols(locale));
|
||||||
|
return teraByteFormat.format((double) byteCount / (1024 * 1024 * 1024 * 1024));
|
||||||
|
}
|
||||||
|
|
||||||
// More than 1 GB?
|
// More than 1 GB?
|
||||||
if (byteCount >= 1024 * 1024 * 1024) {
|
if (byteCount >= 1024 * 1024 * 1024) {
|
||||||
NumberFormat gigaByteFormat = new DecimalFormat("0.00 GB", new DecimalFormatSymbols(locale));
|
NumberFormat gigaByteFormat = new DecimalFormat("0.00 GB", new DecimalFormatSymbols(locale));
|
||||||
|
|||||||
Reference in New Issue
Block a user