Function: convert/euro - convert a currency to the Euro or to another currency
Calling Sequence:
convert(n, 'euro');
convert(n, 'euro', p);
Parameters:
n - a product consisting of a numeric and a name
p - name of another currency
Description:
In the first form, the function converts any amount of a specified curreny to corresponding amount in Euro. n may be a product of a numeric and a name (see below); or just a name, meaning one unit in currency n.
In then second from, the function converts the currency to another currency p. This is being done by first converting n to Euro, and then converting the amount in Euro to currenvy p. This is in accordance to the regulations stipulated by the European Union.
The return is a float, rounded to the second fractional digit. It is padded with zeros if necessary.
Valid currencies are: `ats` (Austria), `bef` (Belgium), `dem` (F.R. Germany), `esp` (Spain), `fim` (Finland), `frf` (France), iep` (Ireland), itl` (Italy), `luf` (Luxembourg), `nlg` (The Netherlands), and `pte` (Portugal). These are the countries that participate in the European Currency Union as of 1999.
You may add other currencies and their rates with respect to the Euro by assigning them to the global table _MathEuro . E.g., on August 12, 1999, one Euro was equal to 1.5136 Canadian Dollars. So assign: _MathEuro[`cad`] = 1.5136. Also you may change rates of the above mentioned European currencies , simply overwrite their table values, e.g. _MathEuro[`dem`] = 1.5, in case the Deutschmark will be devalued with 1 Euro = 1.50 DEM.
Beginning with version 3.6.0 of the math package, you can change or add table entries to _MathEuro in the configuration file math.ini located in the math subdirectory. So you do not need to assign values to _MathEuro every time you start a new Maple session.
This function is part of the math package, and so can be used only after performing the command with(math).
Examples:
> with(math):
reading math ini file: e:/maplev5/math/math.ini
> convert(2*`dem`, euro); # convert 2 Deutschmarks to the Euro
> convert(frf, euro, dem); # convert 1 French Frank to Deutschmarks
> _MathEuro[`cad`] := 1.5136; # Add Canadian Dollar with exchange rate as of August 12, 1999
> convert(`cad`, euro);
See Also:
Version History:
Version 1.0 - August 13, 1999