4D v14.3

Euro converter

Home

 
4D v14.3
Euro converter

Euro converter 


 

Euro converter ( value ; fromCurrency ; toCurrency ) -> Function result 
Parameter Type   Description
value  Real in Value to convert
fromCurrency  String in Code of the currency in which the value is expressed
toCurrency  String in Code of the currency into which the value must be converted
Function result  Real in Converted value

The Euro converter command converts any value from and to the different currencies belonging to “Euroland” and the Euro currency itself.

You can convert:

  • a national currency into Euros,
  • Euros into a national currency,
  • a national currency into another national currency. In this case, the conversion is calculated by the intermediary of the Euro, as specified in the European reglementation. For example, to convert Belgian francs to Deutschemarks, 4D will perform the following calculations: Belgian francs -> Euros -> Deutchemarks.

Pass the value to convert in the first parameter.
The second parameter indicates the Currency code in which value is expressed.
The third parameter indicates the Currency code into which value must be converted.

To specify a Currency code, 4D proposes the following predefined constants, placed in the “Euro Currencies” theme:

Constant Type Value
Austrian Schilling String ATS
Belgian Franc String BEF
Deutsche Mark String DEM
Euro String EUR
Finnish Markka String FIM
French Franc String FRF
Greek Drachma String GRD
Irish Pound String IEP
Italian Lira String ITL
Luxembourg Franc String LUF
Netherlands Guilder String NLG
Portuguese Escudo String PTE
Spanish Peseta String ESP

If necessary, 4D performs rounding automatically on conversion results and keeps 2 decimals —except for conversions to Italian Lires, Belgian Francs, Luxembourg Francs and Spanish Pesetas, for which 4D keeps 0 decimal (the result is an integer number).

The conversion rates between the Euro and the currencies of the 11 participating Member States are fixed:

CurrencyValue for 1 Euro
Austrian Schilling13.7603
Belgian Franc40.3399
Deutschemark1.95583
Finnish Markka5.94573
French Franc6.55957
Greek drachma340.750
Irish Pound0.787564
Italian Lire1936.27
Luxembourg Franc40.3399
Netherlands Guilder2.20371
Portuguese Escudo200.482
Spanish Peseta166.386

Example  

Here are some examples of conversions that can be done with this command:

 $value:=10000 `Value expressed in French Francs
  `Convert the value into Euros
 $InEuros:=Euro converter($value;French Franc;Euro)
  `Convert the value into Italian Lire
 $InLires:=Euro converter($value;French Franc;Italian Lire)

 
PROPERTIES 

Product: 4D
Theme: Math
Number: 676

 
HISTORY 

Modified: 4D v6.7

 
ARTICLE USAGE

4D Language Reference ( 4D v12.4)
4D Language Reference ( 4D v11 SQL Release 6)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v13.5)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)