Name

currency — format number (usually a price) according to currency settings

ATTRIBUTES

Attribute Pos. Req. Default Description
convert Yes   0 Convert the value according to the PriceDivide value for the current locale?
noformat Yes   0 Do not format the price?
display     symbol Display currency as symbol, text or not at all?
interpolate     0 interpolate input?
reparse     1 interpolate output?
hide     0 Hide the tag return value?

DESCRIPTION

The tag returns the price for a specified product.

The currency tag is automatically invoked by the following tags: [price], [subtotal], [salestax], [total_cost].

BEHAVIOR

This tag does not appear to be affected by, or affect, the rest of Interchange.

EXAMPLES

Example: Basic example

[currency]4[/currency]

          

Example: Displaying currency according to PriceDivide

Provided that the PriceDivide configuration directive is set to 0.167, the following example would display 8.982,04:
[currency convert=1] [calc] 500.00 + 1000.00 [/calc] [/currency]

NOTES

AVAILABILITY

currency is available in Interchange versions:

5.0.1-5.7.0 (cvs-head)

SOURCE

Interchange 5.7.0:

Source: code/SystemTag/currency.coretag
Lines: 21


# Copyright 2002-2007 Interchange Development Group and others
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.  See the LICENSE file for details.
# 
# $Id: currency.coretag,v 1.5 2007/03/30 23:40:49 pajamian Exp $

UserTag currency            Order        convert noformat
UserTag currency            hasEndTag
UserTag currency            Interpolate
UserTag currency            addAttr
UserTag currency            PosNumber    2
UserTag currency            Version      $Revision: 1.5 $
UserTag currency            Routine      <<EOR
sub {
my($convert,$noformat,$opt,$amount) = @_;
return Vend::Util::currency($amount, $noformat, $convert, $opt);
}
EOR

AUTHORS

Interchange Development Group

SEE ALSO

salestax(7ic), subtotal(7ic), price(7ic), total-cost(7ic), Locale(7ic), PriceDivide(7ic), PriceCommas(7ic)

DocBook! Interchange!