input|l10n( type )
Name | Type | Description | Required |
---|---|---|---|
type | string | The format that should be used. | Yes. |
This operator formats/localizes miscellaneous numeric values according to the current locale settings. The value that should be formatted must be input using the input parameter. The "type" parameter must be used to select the desired format. The following list reveals the available formats/types.
{def $number=1234.567 $timestamp=currentdate()} time: {$timestamp|l10n( 'time' )} shorttime: {$timestamp|l10n( 'shorttime' )} date: {$timestamp|l10n( 'date' )} shortdate: {$timestamp|l10n( 'shortdate' )} datetime: {$timestamp|l10n( 'datetime' )} shortdatetime: {$timestamp|l10n( 'shortdatetime' )} currency: {$number|l10n( 'currency' )} clean_currency: {$number|l10n( 'clean_currency' )} number: {$number|l10n( 'number' )}
If the current locale is "eng-GB", the following output will be produced:
time : 1:46:05 pm
shorttime : 1:46 pm
date : Friday 06 February 2004
shortdate : 06/02/2004
datetime : Friday 06 February 2004 1:46:05 pm
shortdatetime : 06/02/2004 1:46 pm
currency : £ 1,234.57
clean_currency : 1,234.57
number : 1,234.57