Package DE_EPAGES::Core::API::Object::NumberFormat
At first see 'perldoc Number::Format', this module is based on this CPAN module. Includes extensions like rounding (the Swiss centime) round and corrects the formatting of positive and negative currencies. See also the test script of this package Core/t/NumberFormat.t.
Base |
Number::Format |
Functions
ceiling
Round to ceiling.
Syntax |
my $Ceil = $NumberFormat->ceiling($Number); |
Input |
|
Return |
|
compare
Compares two float numbers (avoid numeric problems).
Syntax |
$result = $Formatter->compare($Amount1, $Amount2); |
Input |
|
Return |
|
format_price
Rounds and formats the number to an currency string
Syntax |
my $Formatted = $NumberFormat->format_price($Number, $Precision); |
Input |
|
Return |
|
new
Creates new formatter/unformatter.
Syntax |
my $NumberFormat = DE_EPAGES::Core::API::Object::NumberFormat->new(%options); |
Input |
|
Return |
|
round
Round the number.
Syntax |
my $Rounded = $NumberFormat->round($Number, $Precision); |
Input |
|
Return |
|
roundTotal
Round the number. Round to 0 or 5 an decimal value for currency CHF.
Syntax |
my $Rounded = $NumberFormat->roundTotal($Number, $Precision); |
Input |
|
Return |
|
unformat_number
Picks up the digits of an currency string.
Syntax |
my $Number = $NumberFormat->unformat_number($Formatted); |
Input |
|
Return |
|