LassoScript Utility
Basics Browse Detail

[Locale_Format]

Tag Link [Locale_Format] Category Math
Type Substitution Source Available Yes
Support Preferred Version 7.0
Change Unchanged Data Source Any
Output Type String Security None
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0

Description

The [Locale_Format] tag formats currency, percentages, and scientific notation in the preferred form for a given language and country or region.

The tag requires three parameters. The first should be a numeric value of type [Currency], [Percent], or [Scientific]. The second should be a language code and the third should be a country or region code.

A list of common language and country codes are listed below. For example, United States formatting is specified using language code 'en' and country code 'US', British formatted is specified using 'en' and 'GB'. Similarly, Spanish formatting is speciified using 'es' and 'ES' while Mexian formatting is specified using 'es' and 'MX'.

Language Codes
da Danish
de German
el Greek
en English
es Spanish
fi Finnish
fr French
he Hebrew
it Italian
ja Japanese
ko Korean
nl Dutch
no Norwegian
pl Polish
pt Portuguese
ru Russian
sv Swedish
zh Chinese

Country Codes
AU Australia
BE Belgium
BR Brazil
CA Canada
CN China
DE Germany
DK Denmark
ES Spain
FI Finland
FR France
GB United Kingdom
GR Greece
IE Ireland
IL Israel
IN India
IT Italy
JP Japan
KR South Korea
MX Mexico
NL Netherlands
NO Norway
PL Poland
PT Portugal
RU Russia
SE Sweden
US United States

Note: Lasso uses the ICU library for locale formatting. Any valid ICU locale codes can be used.

Syntax

[Locale_Format: (Currency: Numeric Value), Language Code, Country Code]

[Locale_Format: (Percent: Numeric Value), Language Code, Country Code]

[Locale_Format: (Scientific: Numeric Value), Language Code, Country Code]

Parameters

Required Parameters
Language Code The language code for the desired locale.
Country Code The language code for the desired locale.
Decimal Value The decimal value to be formatted in [Currency], [Percent], or [Scientific] format.

Change Notes

Note: The separate parameters for language and country code were introduced in Lasso Professional 7.0.2. In prior versions the language and country code could be specified as a name/value pair [locale_format: (currency: 1.00), 'LC'='CC']. This alternate method is still supported in Lasso Professional 7.0.2.

Examples

See the Lasso 8 Language Guide for examples of how to use this tag.