ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Euro functions
  • Exchange table
  • Rounding difference
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Converts a currency into another currency.
Remark: Converted currencies may differ from the Euro. For the conversions into Euros, use eToCurrency and eToEuro.
Example
// Conversion de francs en marks
ResConversion = eChangeCurrency(150, eFRF, eDEM)
Reports and QueriesWindows
// Conversion de Pesetas en Francs Belge avec gestion de l'écart d'arrondi
// Deux décimales sont utilisées pour la conversion
ResConversion = eChangeCurrency(10000, eESP, eBEF, 2, ResEcart)
Syntax
<Result> = eChangeCurrency(<Value to convert> , <Source currency> , <Destination currency> [, <Number of decimals> [, <Rounding difference>]])
<Result>: Currency
Value converted into the specified currency.
<Value to convert>: Currency
Amount to convert. This value is converted:
  • from the <Source Currency> to the currency whose identifier is "0" (the Euro by default),
  • from the currency whose identifier is "0" (the Euro by default) to the <Destination Currency>.
<Source currency>: Integer or constant
Identifier of the source currency or constant associated with the source currency (see the Notes).
<Destination currency>: Integer or constant
Identifier of the destination currency or constant associated with the destination currency (see the Notes).
<Number of decimals>: Optional integer
Number of decimal places used for the result of the conversion (2 by default).
<Rounding difference>: Optional currency
Variable retrieving the rounding difference caused by the conversion. This difference is expressed in the source currency.
Remarks

Exchange table

An exchange table is stored in memory. Each currency is associated with:
  • A currency number used to identify the currency programmatically.
  • A constant used to identify the currency programmatically.
  • A label (7 characters maximum): this label is displayed in the "Currency + Euro" field if the edit control allows it (the $ sign is indicated).
  • An exchange rate. This exchange rate corresponds to the exchange rate of the currency in relation to the Euro.
This exchange table is as follows:
Currency numberConstantCountryExchange rateDefault caption
0eEUREuro zone1EURO
1eFRFFrance6.55957F
2eITLItaly1936.27ITL
3eBEFBelgium40.3399BEF
4eLUFLuxembourg40.3399LUF
5eDEMGermany1.95583DEM
6eATSAustria13.7603ATS
8eESPSpain166.386ESP
9eIEPIreland0.787564IEP
10eNLGNetherlands2.20371NLG
11ePTEPortugal200.482PTE
14eGRDGreece340.750GRD
15eFIMFinland5.94573FIM
Currencies not taking part in the Euro
7eDKKDenmark0DKK
12eGBPGreat Britain0GBP
13eSEKSweden0SEK
16 - 250Free1 to Free10
26eCYPCyprus0CYP
27eCZKCzech Republic0CZK
28eEEKEstonia0EEK
29eHUFHungary0HUF
30eLTLLithuania0LTL
31eLVLLatvia0LVL
32eMTLMalta0MTL
33ePLNPoland0SCH
34eSITSlovenia0SIT
35eSKKSlovakia0SKK
The first currency (whose identifier is set to 0) is the currency used as reference for the conversions.
In this exchange table, you have the ability to:
  • add new currencies by modifying the custom currencies if necessary ("user-defined currencies" from 16 to 25) with eInitCurrency,
  • specify the exchange rate of each currency with eInitCurrency.
Warning Currencies with an exchange rate of zero will not appear in the context menu of the "Monetary + Euro" field. To define the exchange rate of these currencies, you must redefine them in the initialization code of the project with eInitCurrency.
Reports and QueriesWindows

Rounding difference

The <Rounding difference> is calculated by the following formula:
Round(<Value to convert>, <Result in source currency>, <Number of decimals>)
For example:
Écart is currency
ResConversion is currency
ResConversion = eChangeCurrency(1.52, eFRF, eDEM, 2, Écart)
ResConversion is set to 0.45 and Difference is set to 0.01.
The following line of code allows you to retrieve the initial amount:
MontantInit = eChangeCurrency(ResConversion, eDEM, eFRF, 2) + Écart
Component: wd300std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/28/2025

Send a report | Local help