Skip to main content
Skip table of contents

setSimplePercentageFormat

Creates a Format that can be used with Percentage values. This differs from the setPercentageFormat command by not requiring a formatting pattern to be specified, instead providing a somewhat simpler set of attributes for defining the formatting properties.

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 Percentage values. Any command that prints out a Percentage value will then use this format, unless the command specifies a named format for itself. If a default format for Percentage 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 (e.g. "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.

separatedSymbol

Required

Value type

EL-evaluated

No

Boolean

Yes

Defines if a space is placed between the numeric part and the percent symbol in the formatted Percentage value. Should the resolved value be "true", the space is placed.

If not defined, a value of "false" is used and no space is placed.

fractionDigits

Required

Value type

EL-evaluated

No

String

Yes

Defines the amount of digits in the fractional part of the formatted Percentage 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 Percentage 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 Percentage 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.