Handel::CurrencyHandel::Currency is a price container to do currency conversion/formatting. | |
Download |
Handel::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::Currency Tags
Handel::Currency Description
Handel::Currency is a price container to do currency conversion/formatting. Handel::Currency is a price container to do currency conversion/formatting.SYNOPSIS use Handel::Currency; my $price = Handel::Currency->new(1.2. 'USD'); print $price; # 1.20 USD print $price+1 # 2.2 print $price->code; # USD print $price->format; # FMT_SYMBOL print $price->as_string; # 1.20 USD print $price->as_string('FMT_SYMBOL'); # $1.20 print 'Your price in Canadian Dollars is: '; print $price->convert('CAD')->value;The Handel::Currency module provides basic currency formatting within Handel using Data::Currency. It can be used separately to format any number into a more friendly formatted currency string. my $price = 1.23; my $currency = Handel::Currency->new($price); print $currency->as_string;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->as_string; # 12.90 USDEach Handel::Currency object will stringify to the original value except in string context, where it stringifies to the format specified in format.Requirements:· Perl Requirements: · Perl
Handel::Currency Related Software