Skip to main content
Skip table of contents

setSimpleCurrencyFormat

Creates a Format that can be used with Currency values. This differs from the setCurrencyFormat command by not requiring a formatting pattern to be specified, instead providing a somewhat simpler set of attributes for defining the formatting properties. In many cases just having the locale attribute resolve into a suitable value can be enough to format Currency values appropriately.

Attributes

name

Required

Value type

EL-evaluated

No

String

Yes

Defines a name for the created format. If defined, other commands can choose to use this format by referring to it by this name.  

Leaving the created format nameless declares it as the default format for Currency values. Any command that prints out a Currency value will then use this format, unless the command specifies a named format for itself. If a default format for Currency values has already been set, this new format will take its place as the default.

locale

Required

Value type

EL-evaluated

No

String

Yes

Specifies a locale for this format, 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 format requires the country information.

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

currencySymbol

Required

Value type

EL-evaluated

No

String

Yes

Defines the currency symbol appearing in the formatted Currency value. Whatever String this attribute resolves into will be used as the symbol.

If not defined, a locale-dependent default value will be used.

currencySymbolPosition

Required

Value type

EL-evaluated

No

String

Yes

Defines the position of the currency symbol in the formatted Currency value. The resolved value is expected to be one of the following:

  • prefix - Places the symbol in front of the numeric value ("$700")

  • prefixSeparated - Places the symbol in front of the numeric value, but separated by a space ("$ 700")

  • suffix - Places the symbol after the numeric value ("700€")

  • suffixSeparated - Places the symbol after the numeric value, but separated by a space ("700 €")

If not defined, a locale-dependent default value will be used.

fractionDigits

Required

Value type

EL-evaluated

No

String

Yes

Defines the amount of digits in the fractional part of the formatted Currency value.

If not defined, a locale-dependent default value will be used.

trimFraction

Required

Value type

EL-evaluated

No

Boolean

Yes

Defines if trailing zeros in the formatted Currency value's fractional part are removed. If the resolved value is "true", any trailing zeros are removed. Note that this may cause the amount of fractional digits to become less than what the fractionDigits attribute defines.

If not defined, value of "false" is used and any trailing zeros will remain.

useGrouping

Required

Value type

EL-evaluated

No

Boolean

Yes

Defines if the digits in the integer part of the formatted Currency value are grouped, should the amount of digits be high enough. If the resolved value is "true", grouping is used.

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

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.