Podius::Property::CurrencyAmount - component property representing units in certain currency
$property = new Podius::Property::CurrencyAmount;
Supposed to be used in the Podius::Component manpage and the Podius::Property manpage module trees only.
This module implements component property allowing easy representation of price or cost in certain currency. The currency is usually taken from another property of the same or relative component (but it may be more flexible than this). The exact way to access the currency should be defined for this property.
This property derives from Number and has all its features. Additionally, there is an option to convert the current value to another currency (if possible) and make other currency manipulations.
Only the methods different from the Podius::Property::Scalar manpage are described here.
the Podius::Property::Number manpage, the Podius::Property::Currency manpage.
* class name
* initial value (may be undef or 0)
* currency property name of the same owner component, or subroutine
(taking owner component as param and returning Currency property)
Also see the Podius::Property::Currency manpage, access method.
* optional new currency code (only sane for static properties)
Returns the assigned currenct sign, like ``$'' or euro-sign. Usually this is one unicode chars or abbreviature.
Also see the Podius::Property::Currency manpage, access_sign method.
Returns the assigned currenct label, like ``US Dollar'' or ``Euro''. This label may contain unicode chars for certain currencies.
Also see the Podius::Property::Currency manpage, access_label method.
Returns the amount converted to another currency. By default the precision is currency-dependent (usually 2 for most of the world currencies, but may be 0 or 3).
It is possible to make adjustment to the managed amount (relative or absolute, or even replace it) by passing the corresponding parameter, pass any false value to disable adjustment.
Also see the Podius::Property::Currency manpage, convert_amount_to_currency method.
* other currency (property or code) * adjustment (+X, -X, +X%, -X%, X, or undef/"" to disable) * precision (0..8, or 9 - as-is, or undef/"" for actual sub-units)
access_currency method.