Menu

setCurrencyParser

Creates a parser that can make Currency values out of Strings.

Parsers can be used in the logic with the set command, and in document content with the content logic attribute.

Attributes

name

Required
Value type
EL-evaluated
Yes String Yes
Defines a name for the created parser. Other commands can choose to use this parser by referring to it by this name.
locale

Required
Value type
EL-evaluated
No String Yes
Specifies a locale for this parser, affecting the formatting rules. The resolved String should be an ISO-639 language code and an ISO-3166 country code, joined by a hyphen or an underscore (eg. "en-US" or "en_US"). Alternatively the value may only specify the language code, but this may lead to unpredictable results if this parser requires the country information.

If not defined, the parser will follow the user's default locale.
currencyIsoCode

Required
Value type
EL-evaluated
No String Yes
Defines the currency of this parser. The resolved String should be an ISO 4217 currency code.

If not defined, the currency of this parser will be the same as that of the active user's Salesforce organization. If the organization uses multiple currencies, then the currency will be the default currency set for the user.     
pattern

Required
Value type
EL-evaluated
No String No
The value of this attribute is used as the pattern this parser uses to read Strings and form them into Currency values.

If not defined, a locale-dependent standard pattern will be used.
currencySymbol

Required
Value type
EL-evaluated
No String Yes
Defines the symbol that this parser interprets as the currency symbol.

If not defined, the symbol is defined by locale and currencyIsoCode.
decimalSeparator

Required
Value type
EL-evaluated
No String Yes
Defines the symbol that this parser interprets as the decimal separator.

If not defined, a locale-dependent decimal separator is used.
groupingSeparator

Required
Value type
EL-evaluated
No String Yes
Defines the symbol that this parser interprets as the grouping separator.

If not defined, a locale-dependent default grouping separator is used.

Examples

A functional Currency parser requires a pattern specific to the kinds of Strings representing monetary values that your logic has. Also make use of the other attributes specifying what characters are interpreted as different symbols. For a String like "22500,75€" to become a Currency value, a parser like this would work:

<setCurrencyParser name="moneyReader" pattern="#########.00¤" decimalSeparator="," currencySymbol="€">

Comments

0 comments