Lasso Soft Inc. > Home

[ locale->formatAs ]

Method

The [locale-formatAs] method us used to format the output of various values in the format of the locale.

This method has several sets of parameters that may accept for formatting. 

  • a single integer. This formats the thousands separators according to the locale
  • a decimal value and a locale keyword. This formats the value as the keyword type in the format of the locale. Valid keywords are: currency and scientific (invalid keywords have no effect)
  • a ucal value along with 3 integers.
  • Syntax
locale->formatAs(decimal, 'keyword')

locale->formatAs( integer )
Examples
  • Beginner

Express numeric values in a given country's format.

Use the [locale->formatAs] method.

The following example outputs a large integer and a currency value in the format expected in Germany.

Code

local( myLocale = locale_germany)

#myLocale->formatAs(29.99, 'currency')+'\n'

#myLocale->formatAs(34596003)+'\n'

Result

29,99 €
34.596.003

Recent Comments

No Comments found

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft