The FileSizeFormat is a static class for formatting and parsing numeric file size values according to a set of format options.
Supports the same options as NumberFormat.getFloatInstance For format options which are not specified default values according to the type and locale settings are used.
Supported format options (additional to NumberFormat):
Method | Description |
---|---|
sap.ui.core.format.FileSizeFormat.extend |
Creates a new subclass of class sap.ui.core.format.FileSizeFormat with name
|
format |
Format a filesize (in bytes) according to the given format options. |
sap.ui.core.format.FileSizeFormat.getInstance |
Get an instance of the FileSizeFormat, which can be used for formatting. If no locale is given, the currently configured formatLocale will be used. |
sap.ui.core.format.FileSizeFormat.getMetadata |
Returns a metadata object for class sap.ui.core.format.FileSizeFormat. |
parse |
Parse a string which is formatted according to the given format options. |
Creates a new subclass of class sap.ui.core.format.FileSizeFormat with name sClassName
and enriches it with the information contained in oClassInfo
.
oClassInfo
might contain the same kind of information as described in sap.ui.base.Object.extend.
Param | Type | DefaultValue | Description |
---|---|---|---|
sClassName | string |
Name of the class being created |
|
oClassInfo | object |
Object literal with information about the class |
|
FNMetaImpl | function |
Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class |
Format a filesize (in bytes) according to the given format options.
Param | Type | DefaultValue | Description |
---|---|---|---|
oValue | number string |
the number (or hex string) to format |
Get an instance of the FileSizeFormat, which can be used for formatting.
If no locale is given, the currently configured formatLocale will be used.
Param | Type | DefaultValue | Description |
---|---|---|---|
oFormatOptions | object |
Object which defines the format options |
|
oLocale | sap.ui.core.Locale |
Locale to get the formatter for |