Lasso Soft Inc. > Home

[ locale->FORMAT ]

Method

The [locale->format] method is used to display various values in the format of the given locale.

The method requires one parameter which is the decimal, integer, date value to be formatted.

Note: when formatting dates the method accepts up to 3 additional integer flags which specify different date/time formatting types.

  • Syntax
locale->format( decimal )
locale->format( integer )
locale->format( date_time )
locale->format( time )
locale->format (date, date_display_flag, time_display_flag, additional_display_flag )
Examples
  • Beginner

Format dates, times, decimals and integers for different locations

Use the [locale->format] method. This example shows how various elements are formatted for French Canada.

Code

local( aLocale = locale_canadafrench,
     myDate = dateandtime(date),
     myTime = timeonly(date),
     myDecimal = 25.99,
     myInteger = 209545869)

#aLocale->format(#myDate)+'\n'
#aLocale->format(#myTime)+'\n'
#aLocale->format(#myDecimal)+'\n'
#aLocale->format(#myInteger)+'\n'
#aLocale->format(date, 1, 1 )

Result

2011-02-19 10 h 45 min 15 s heure normale de l’Est
10:45:15
25,99
209 545 869
19 février 2011 10 h 45 min 15 s heure normale de l’Est

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