Class sap.ca.ui.model.format.FileSizeFormatModule: sap/ca/ui/model/format/FileSizeFormat


The FileSizeFormat is a static class for formatting and parsing file size values according to a set of format options.

Simplified logic: display in kB for 1e3 <= bytes < 1e6 display in MB for 1e6 <= bytes < 1e9 ...

Deprecated API:Deprecated API:Since version 1.28. This control has been made available in sap.ui.core. Please use sap.ui.core.format.FileSizeFormat instead! This control will not be supported anymore.

Constructor Summary
new sap.ca.ui.model.format.FileSizeFormat()Constructor for FileSizeFormat - must not be used: To get a FileSizeFormat instance, please use getInstance.
Method Summary
sap.ca.ui.model.format.FileSizeFormat.getInstance(oFormatOptions?, oLocale?)Get a instance of the FileSizeFormat, which can be used for formatting.
format(oValue)Format according to the given format options.
parse(sValue)Parse a string which is formatted according to the given format options.
Constructor Detail
new sap.ca.ui.model.format.FileSizeFormat()
Constructor for FileSizeFormat - must not be used: To get a FileSizeFormat instance, please use getInstance.
Deprecated:
Deprecated API:Since version 1.28. This control has been made available in sap.ui.core. Please use sap.ui.core.format.FileSizeFormat instead! This control will not be supported anymore.
Method Detail
sap.ca.ui.model.format.FileSizeFormat.getInstance(oFormatOptions?, oLocale?): sap.ca.ui.model.format.FileSizeFormat
Get a instance of the FileSizeFormat, which can be used for formatting.
Parameters:
{object}oFormatOptions? Object which defines the format options
{number}oFormatOptions.shortDecimals? number of decimals to use.
{sap.ui.core.Locale}oLocale? Locale to ask for locale specific texts/settings
Returns:
{sap.ca.ui.model.format.FileSizeFormat} instance of the FileSizeFormat
format(oValue): string
Format according to the given format options.
Parameters:
{FileSize}oValue the value to format
Returns:
{string} the formatted output value
parse(sValue): number
Parse a string which is formatted according to the given format options.
Parameters:
{string}sValue the string containing a formatted value
Returns:
{number} the parsed value