Class FormattingUtils
java.lang.Object
org.torproject.metrics.descriptorparser.utils.FormattingUtils
Static helper methods for string processing etc.
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
formatBytes
(long bytes) Formats the given number of bytes as B, KiB, MiB, GiB, etc.static String
formatDecimalNumber
(long decimalNumber) Formats the given decimal number with a comma as thousands separator.static String
formatMillis
(long millis) Formats the given number of milliseconds using the format"${minutes}:${seconds}.{milliseconds} minutes"
.static String
replaceValidUtf
(String text) De-escape only valid UTF and leave anything else escaped.
-
Method Details
-
formatMillis
Formats the given number of milliseconds using the format"${minutes}:${seconds}.{milliseconds} minutes"
. -
formatBytes
Formats the given number of bytes as B, KiB, MiB, GiB, etc. -
formatDecimalNumber
Formats the given decimal number with a comma as thousands separator. -
replaceValidUtf
De-escape only valid UTF and leave anything else escaped.
-