Language customization

The output of the format function is determined by a language independent mask. Some of the symbols expand, depending on the active output language, and can be changed by the Template.

The following symbols are based on the active output language.

Symbol

Representation

$

Single-character currency symbol

U

Multi-character currency symbol

.

Decimal point

,

Thousand separator

The template can change these expansions at any time:

  • Through the language_code function (see language_code). The default output language is set in KCM Core Administrator. Changing the output language affects all four symbols.
  • Through the euro function (see euro). This function affects the currency symbols ($ and U).
  • Using the pragma function to override specific values (see pragma):

Pragma key

Symbol

Length

Representation

LOCALE:LC_MONETARY:int_curr_symbol

U

3

Multi-character currency symbol

LOCALE:LC_MONETARY:currency_symbol

$

1

Single-character currency symbol

LOCALE:LC_NUMERIC:decimal_point

.

1

Decimal point

LOCALE:LC_NUMERIC:thousands_sep

,

1

Thousand separator

The pragma function should be used to replace symbols with alternatives that have the appropriate length for the symbol. Using alternatives with incorrect lengths is not supported and can result in values that are not aligned correctly.

The built-in language support defines currency symbols for the supported languages. For legacy reasons, Euro support is by default disabled.

Output language

$

U

Euro support enabled

EUR

DAN

:

DKK

DES

F

CHF

DEU

$

DEM

ENG

£

GBP

ENU

$

USD

ESP

$

ESP

FRA

F

FRF

FRB

F

BEF

FRS

F

CHF

HUN

F

HUF

ITS

F

CHF

NLB

F

BEF

NLD

ƒ

NLG

POL

Z

PLN

PTG

Z

PTE

SVE

F

SEK

Examples

format (0.12; "$$$9.99") results in "øø£0.12"

format (0.12; "$$$9.99") results in "øøF0,12" (output language DES / de-CH)

format (1234.56; "U,UUU,UU9.99") results in "øGBP1,234.56"

format (1234.56; "U,UUU,UU9.99") results in "øCHF1.234,56" (output language DES / de-CH)

pragma ("LOCAL:LC_MONETARY:int_curr_symbol"; "CNY") changes the U symbol to CNY

format (1234.56; "U,UUU,UU9.99") results in "øCNY1,234.56"