Class FormattingUtils
- java.lang.Object
-
- org.torproject.metrics.onionoo.util.FormattingUtils
-
public class FormattingUtils extends java.lang.ObjectStatic helper methods for string processing etc.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringformatBytes(long bytes)Formats the given number of bytes as B, KiB, MiB, GiB, etc.static java.lang.StringformatDecimalNumber(long decimalNumber)Formats the given decimal number with a comma as thousands separator.static java.lang.StringformatMillis(long millis)Formats the given number of milliseconds using the format"${minutes}:${seconds}.{milliseconds} minutes".static java.lang.StringreplaceValidUtf(java.lang.String text)De-escape only valid UTF and leave anything else escaped.
-
-
-
Method Detail
-
formatMillis
public static java.lang.String formatMillis(long millis)
Formats the given number of milliseconds using the format"${minutes}:${seconds}.{milliseconds} minutes".
-
formatBytes
public static java.lang.String formatBytes(long bytes)
Formats the given number of bytes as B, KiB, MiB, GiB, etc.
-
formatDecimalNumber
public static java.lang.String formatDecimalNumber(long decimalNumber)
Formats the given decimal number with a comma as thousands separator.
-
replaceValidUtf
public static java.lang.String replaceValidUtf(java.lang.String text)
De-escape only valid UTF and leave anything else escaped.
-
-