NAME AxKit::XSP::Currency - Currency formatting and conversion taglib SYNOPSIS Add this taglib to AxKit in your http.conf or .htaccess: AxAddXSPTaglib AxKit::XSP::Currency Add the namespace to your XSP file and use the tags: 19.5 USD FMT_HTML 10.95 10.92 DESCRIPTION This tag library provides an interface to format and convert currency values within XSP pages. CHANGES As of version 0.10, the defaults have changed. If no "options" are specified for "symbol", the default is now "SYM_UTF" instead of "SYM_HTML". If no "options" are specified for "format", "FMT_SYMBOL" is used instead of "FMT_HTML". TAG HIERARCHY 10.95 TAG REFERENCE Given a price, usually in decimal form, format returns a formatted price using the various options in "Locale::Currency::Format". 10.9 # prints $10.50 The "format" tag has three available attributes to control the output: code This is the 3 letter currency code used to specify the currency in use. The "code" attribute can also be specified using a child tag instead: USD "USD" is used as the default if no currency code is specified. See "Locale::Currency::Format" and "Locale::Currencty" for all of the available currency codes. If "Locale::Currency" is installed, it will verify the 3 letter code is actually a valid currency code and die if it is not, otherwise it simply checks that the code conforms to: /^[A-Z]{3}$/ options This is a string containing the formatting options to be used to specify the desired output format. The "options" attribute can also be specified using a child tag instead: FMT_STANDARD | FMT_NOZEROS "FMT_SYMBOL" is used as the default if no options are specified. See "Locale::Currency::Format" for all of the available format options. price This is the price to be formatted. While it can be passed as an attribute, the more common usage will be as a child tag: 19.95 You can also next a "convert" tag inside of "price" to format the results of a currency conversion: Returns the monetary symbol for the specified currency code. # prints $ The "symbol" tag has two available attributes to control the output: code This is the 3 letter currency code used to specify the currency in use. The "code" attribute can also be specified using a child tag instead: USD "USD" is used as the default if no currency code is specified. See "Locale::Currency::Format" for all of the available currency codes. If "Locale::Currency" is installed, it will verify the 3 letter code is actually a valid currency code and die if it is not, otherwise it simply checks that the code conforms to: /^[A-Z]{3}$/ options This is a string containing the formatting options to be used to specify the desired output format. The "options" attribute can also be specified using a child tag instead: SYM_HTML|SYM_UTF "SYM_UTF" is used as the default if no options are specified. See "Locale::Currency::Format" for all of the available format options. Converts a price from one currency to another using "Finance::Currency::Convert::WebserviceX". The "convert" tag has three available attributes to control the output: from This is the 3 letter currency code used to specify the currency in use. The "from" attribute can also be specified using a child tag instead: USD "USD" is used as the default if no currency code is specified. If "Locale::Currency" is installed, it will verify the 3 letter code is actually a valid currency code and die if it is not, otherwise it simply checks that the code conforms to: /^[A-Z]{3}$/ See "Locale::Currency" for all of the available currency codes. price This is the price to be formatted. While it can be passed as an attribute, the more common usage will be as a child tag: 19.95 to This is the 3 letter currency code used to specify the currency in use. The "to" attribute can also be specified using a child tag instead: USD If "Locale::Currency" is installed, it will verify the 3 letter code is actually a valid currency code and die if it is not, otherwise it simply checks that the code conforms to: /^[A-Z]{3}$/ See "Locale::Currency" for all of the available currency codes. SEE ALSO Locale::Currency::Format, Locale::Currency AUTHOR Christopher H. Laco CPAN ID: CLACO claco@chrislaco.com http://today.icantfocus.com/blog/