PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Exchange table
  • Rounding difference
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
eToCurrency (Function)
In French: eVersDevise
Converts a value expressed in Euro into another currency.
WEBDEV - Browser code Important: In browser code, eToCurrency is used to perform approximate calculations without refreshing the page beside the server (save time during the Internet connections). The precision of the calculations performed in browser code does not correspond to the Euro standard. To perform precise calculations, we advise you to send the page back to the server and to perform the calculations in a server code.
Versions 18 and later
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Universal Windows 10 App This function is now available in Windows Store apps mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
// Convert Euros into Marks
ResConversion = eToCurrency(150, eDEM)
WINDEVWEBDEV - Server codeReports and QueriesWindows MobilePHPAjaxUser code (UMC)
// Convert Euros into Irish punts and manage the rounding difference
// Two decimal places are used for the conversion
ResConversion = eToCurrency(10000, eIEP, 2, ResDiff)
Syntax
<Result> = eToCurrency(<Value to Convert> [, <Destination Currency> [, <Number of Decimals> [, <Rounding difference>]]])
<Result>: Currency
Value converted into the specified currency.
WEBDEV - Browser code This parameter is a real.
<Value to Convert>: Currency
Amount in Euros to convert.
WEBDEV - Browser code This parameter is a real.
<Destination Currency>: Integer or constant (optional)
Identifier of the destination currency or constant associated with the destination currency. If this parameter is not specified, the function converts the specified value into the currency whose identifier is "1" (the French Franc by default).
<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.
This parameter is useful for the currencies whose exchange rate is less than the Euro (Irish Punt). For the other currencies, this parameter is always null.
WEBDEV - Browser code This parameter is not available. No rounding difference can be retrieved.
Remarks

Exchange table

An exchange table is stored in memory. Each currency is associated with:
  • A currency number used to identify the currency by programming.
  • A constant used to identify the currency by programming.
  • A caption (up to 7 characters): this caption is displayed in the "Currency + Euro" control if the input mask 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.386SPC
9eIEPIreland0.787564IEP
10eNLGNetherlands2.20371NLG
11ePTEPortugal200.482PTE
14eGRDGreece340.750GRD
15eFIMFinland5.94573FIM
Currencies not taking part in the Euro
7eDKKDenmark0DKK
12eGBPGreat Britain0GBP
13eSEKSweden0SEK
16 - 25 0Free1 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.
Caution: The currencies whose exchange rate is set to 0 will not be displayed in the popup menu of the "Currency + Euro" control. To define the exchange rate of these currencies, you must redefine them in the initialization code of the project with eInitCurrency.
WINDEVWEBDEV - Server codeReports and QueriesWindows MobileUniversal Windows 10 AppPHPAjaxUser code (UMC)

Rounding difference

The <Rounding Difference> is calculated by the following formula:
Round(<Value to Convert>, <Result in Source Currency>, <Number of Decimals>)
For example:
Difference, ResConversion are currencies
ResConversion = eToCurrency(50, eIEP, 2, Difference)
ResConversion is set to 34,94 and Difference is set to 0,01.
The following code line allows you to retrieve the initial amount:
InitAmount = eToEuro(ResConversion, eIEP, 2) - Difference
Components
WINDEVWEBDEV - Server codeReports and Queries wd230std.dll
Windows Mobile wp230std.dll
WEBDEV - Browser code WDJS.DLL
Linux wd230std.so
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment