For more information... RTFM!
NAVIGATION
PAGES THAT LINK HERE
ACCOUNT LOGIN

You are not logged in

Powered by Interchange version 5.7.0

currency

Format a value according to a currency specification.

Summary

  • [currency convert noformat] Numeric value to format/convert [/currency]

Parameter Description Default
convert Convert the amount according to the PriceDivide value for the current locale. None
noformat Don't format the result using a currency symbol etc. No
locale Override the current locale for this call. None
display Display the currency identifier as a symbol, as plain text or not at all. symbol
interpolate

Parse Interchange tags, included in the body text, before this container tag executes.

Yes

Examples

Tag expansion example

[currency] 123.45 [/currency]
$123.45

Perl example

$Tag->currency({
    convert => $convert,
    noformat => $noformat,
    body => $price,
});

or similarly with positional parameters: 

$Tag->currency($convert, $noformat, $attribute_hash_reference, $price);

Description

When passed a value of a single number this tag formats it according to the currency specification.  For instance:

[currency] 4 [/currency]

will display:

$4.00

or, depending on your Locale and PriceCommas settings, it might display something else.

This tag is automatically invoked by [price], [handling], [salestax], [subtotal], [total-cost], [PREFIX-price] and [PREFIX-subtotal], unless the "noformat" parameter is passed to those tags.

Parameters

convert

Convert the value according to PriceDivide for the current locale.  If Locale is set to "fr_FR", and the PriceDivide setting for "fr_FR" is 0.78396 then the following call:

[currency convert=1] [calcn] 500.00 + 1000.00 [/calcn] [/currency]

will display:

EUR 1.175,94

noformat

Do not apply currency formatting (symbol etc.) to the output value.  This could be useful if you only need the exchange rate conversion value.

display

The currency identifier will usually be displayed as a symbol (i.e. "£" or "$" etc.).  If this parameter is set to "text" then the currency identifier will be displayed as plain text (i.e. "GBP" or "USD" etc.), depending upon the locale settings.  If this parameter is set to "none" then the currency identifier will not be displayed at all.

locale

This parameter allows you to override the current locale that would be used to format the result and provide the exchange rate.

Note

Note

Setting this parameter causes the convert parameter to also be set, unless you specify "convert=0".

Category:  Interchange tags
Last modified by: Kevin Walsh
Modification date: Thursday 16 November 2006 at 10:43 AM (CST)
Home  |  Legal nonsense  |  Privacy policy  |  Donations  |  Contact us