Handel::Compat::CurrencyHandel::Compat::Currency is a price container to do currency conversion/formatting. | |
Download |
Handel::Compat::Currency Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Christopher H. Laco
- Publisher web site:
- http://search.cpan.org/~claco/Handel-1.00009/lib/Handel/Manual/QuickStart.pod
Handel::Compat::Currency Tags
Handel::Compat::Currency Description
Handel::Compat::Currency is a price container to do currency conversion/formatting. Handel::Compat::Currency is a price container to do currency conversion/formatting.SYNOPSIS use Handel::Compat::Currency; MyStorage->currency_class('Handel::Compt::Currency'); my $curr = Handel::Currency->new(1.2); print $curr->format(); # 1.20 USD print $curr->format('CAD'); # 1.20 CAD print $curr->format(undef, 'FMT_SYMBOL'); # $1.20 print 'Your price in Canadian Dollars is: '; print $curr->convert('USD', 'CAD');The Handel::Currency module provides basic currency formatting within Handel. It can be used separately to format any number into a more friendly format: my $price = 1.23; my $currency = Handel::Currency->new($price); print $currency->format;A new Handel::Currency object is automatically returned within the shopping cart when calling subtotal, total, and price as an lvalue: my $cart = Handel::Cart->search({id => '11111111-1111-1111-1111-111111111111'}); print $cart->subtotal; # 12.9 print $cart->subtotal->format(); # 12.90 USDBy default, a Handel::Currency object will stringify to the original decimal based price. Requirements: · Perl
Handel::Compat::Currency Related Software