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 USD
Each Handel::Currency object will stringify to the original value except in string context, where it stringifies to the format specified in format.
Requirements:
· Perl
Product's homepage
Requirements:
· Perl