currency — format number (usually a price) according to currency settings
| 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? |
The tag returns the price for a specified product.
The currency tag is automatically invoked by the following tags:
[price], [subtotal], [salestax], [total_cost].
Example: Displaying currency according to PriceDivide
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]
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