Euro converter

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 6.7 (Modified)


Euro converter (value; fromCurrency; toCurrency) Real

ParameterTypeDescription
valueRealValue to convert
fromCurrencyStringCode of the currency in which the value is expressed
toCurrencyStringCode of the currency into which the value must be
converted
Function resultRealConverted value

Description

The Euro converter command allows you to convert any value from and to the different currencies belonging to the "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, 4th Dimension proposes the following predefined constants, placed in the "Euro Currencies" theme:

ConstantTypeValue
Austrian SchillingStringATS
Belgian FrancStringBEF
DeutschemarkStringDEM
EuroStringEUR
Finnish MarkkaStringFIM
French FrancStringFRF
Greek drachmaStringGRD
Irish PoundStringIEP
Italian LireStringITL
Luxembourg FrancStringLUF
Netherlands GuilderStringNLG
Portuguese EscudoStringPTE
Spanish PesetaStringESP

If necessary, 4th Dimension 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)

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next