This class represents the composite type Currency
, which consists of the parts "amount" (of type number
or string
) and "currency" (of type string
). In case the amount is a string
, it must be the JavaScript representation of the corresponding number. If the source
format option is given, the composite type has only one part of type string
, holding both amount and currency in the source format.
Constructor for a Currency
type.
new sap.ui.model.type.Currency(oFormatOptions?, oConstraints?)
Param | Type | Default Value | Description |
---|---|---|---|
oFormatOptions? | object | Format options; for a list of all available options, see sap.ui.core.format.NumberFormat.getCurrencyInstance. If the format options |
|
preserveDecimals? | boolean | true | By default decimals are preserved, unless |
source? | object | A set of format options as defined for sap.ui.core.format.NumberFormat.getCurrencyInstance which describes the format of amount and currency in the model in case the model holds this in one property of type |
|
oConstraints? | object | Constraints for the value part |
|
minimum? | number | Smallest amount allowed excluding the minimum value itself |
|
maximum? | number | Largest amount allowed excluding the maximum value itself |
Method | Description |
---|---|
sap.ui.model.type.Currency.extend |
Creates a new subclass of class sap.ui.model.type.Currency with name
|
formatValue |
Formats the given value to the given target type. |
sap.ui.model.type.Currency.getMetadata |
Returns a metadata object for class sap.ui.model.type.Currency. |
getPartsIgnoringMessages |
Gets an array of indices that determine which parts of this type shall not propagate their model messages to the attached control. Prerequisite is that the corresponding binding supports this feature, see sap.ui.model.Binding#supportsIgnoreMessages. If the format option
|
parseValue |
Parses a string value. |
Creates a new subclass of class sap.ui.model.type.Currency 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.model.CompositeType.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 |
Formats the given value to the given target type.
Param | Type | DefaultValue | Description |
---|---|---|---|
vValue | any[] string |
The array containing amount and currency code in case the |
|
sTargetType | string |
The target type; must be "string", or a type with "string" as its primitive type |
Returns a metadata object for class sap.ui.model.type.Currency.
Gets an array of indices that determine which parts of this type shall not propagate their model messages to the attached control. Prerequisite is that the corresponding binding supports this feature, see sap.ui.model.Binding#supportsIgnoreMessages. If the format option showMeasure
is set to false
and the currency value is not shown in the control, the part for the currency code shall not propagate model messages to the control. Analogously, since 1.89.0, if the format option showNumber
is set to false
, the amount is not shown in the control and the part for the amount shall not propagate model messages to the control.
References:
Parses a string value.
Param | Type | DefaultValue | Description |
---|---|---|---|
sValue | string |
The value to be parsed |
|
sSourceType | string |
The source type (the expected type of |
|
aCurrentValues | array |
Not used |