Class ByteSizeFormatter
java.lang.Object
org.hippoecm.frontend.plugins.standards.util.ByteSizeFormatter
- All Implemented Interfaces:
Serializable
,org.apache.wicket.util.io.IClusterable
Formats numeric byte values into human-readable strings.
- See Also:
-
Constructor Summary
ConstructorDescriptionByteSizeFormatter
(int decimalPlaces) ByteSizeFormatter
(String gigabyteSuffix, String megabyteSuffix, String kilobyteSuffix, String byteSuffix, int decimalPlaces) -
Method Summary
-
Constructor Details
-
ByteSizeFormatter
public ByteSizeFormatter() -
ByteSizeFormatter
public ByteSizeFormatter(int decimalPlaces) -
ByteSizeFormatter
-
-
Method Details
-
format
Formats filesize in bytes as appropriate to bytes, KB, MB or GB. By default, it formats based on the current user's locale information if available.- Parameters:
filesize
- in bytes- Returns:
- formatted filesize
-
format
Formats filesize in bytes as appropriate to bytes, KB, MB or GB, based on the givenlocale
. If thelocale
is null, then the default locale will be used.- Parameters:
filesize
- in bytesloc
- Locale- Returns:
- formatted filesize
-