ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Euro functions
  • Overview
  • Stored currency
  • Overview
  • Configuring the stored currency
  • Input/Display currency
  • Overview
  • Advanced configuration
  • Configuring the display currency
  • Tooltip
  • Overview
  • Conversion rules in the tooltip
  • Configuring the display of tooltip
  • Dual display
  • Overview
  • Operating mode of dual display for an edit control
  • Operating mode of dual display for a table column
  • Advanced configuration
  • Configuring the dual display
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Currency + Euro type
Overview
In a WINDEV application or in a WEBDEV site, the Euro must be managed in all the controls used to enter or display currency values:
All these controls can be defined as "Currency + Euro" controls.
The characteristics specific to this type of control are as follows:
WEBDEV - Server code Only the stored currency and the input currency are available in this version.
Stored currency

Overview

The stored currency corresponds to the currency of the value returned to the program or transferred into an item. The stored currency is used for all the calculations that will be performed in the application.
You have the ability to specify the number of decimal places taken into account by this stored currency (5 by default). The value found in the stored currency will be automatically rounded according to the number of decimal places.
The results can be displayed in any currency selected in "Input/Display currency". The conversion will be automatically performed.
The stored currency associated with a control can be modified through programming with MemoryCurrency.
Caution: To avoid errors, we recommend that you use the same number of decimal places:
  • in the display mask and in the input mask of the control,
  • in the rounding of the stored currency.

Configuring the stored currency

The stored currency is chosen in the window editor or in the report editor from a list displaying the different currencies. This list contains:
  • the number identifying the currency,
  • the abbreviation of the currency according to the ISO standard,
  • the name of the country corresponding to this currency.
The last four currencies of this list are user-defined currencies: they allow choosing an additional currency created through programming with eInitCurrency.
Remark: The <Default> currency corresponds to the Euro. This default currency can be identified and changed using eDefaultMemCurrency.
Input/Display currency

Overview

The display currency corresponds the currency in which the value of the control is displayed or entered. The display currency is displayed according to the input mask specified for the control.
If the displayed currency differs from the stored currency, the conversion is automatically performed between the display currency and the stored currency. Using a display currency that differs from the stored currency allows you to store a single currency in the data file: the stored value can be displayed in any currency.
Caution: To avoid errors, we recommend that you use the same number of decimal places:
  • in the display mask and in the input mask of the control,
  • in the rounding of the stored currency.
The displayed currency can be changed using the DisplayCurrency property.
Windows

Advanced configuration

Some advanced parameters can be used for an edit control and for a table column:
  • Change currency via the context menu: The user will have the ability to choose the display currency via a context menu. This context menu presents the result of the conversion for the value entered in the different currencies. The context menu only shows currencies with exchange rates different from zero.
  • Display a tilde (~) in case of rounding difference: This tilde indicates a rounding difference between the value expressed in the display currency and the value expressed in the stored currency.

Configuring the display currency

The displayed currency is chosen in the window editor from a list displaying the different currencies. This list contains:
  • the number identifying the currency,
  • the abbreviation of the currency according to the ISO standard,
  • the name of the country corresponding to this currency.
The last four currencies of this list are user-defined currencies: they allow choosing an additional currency created through programming with eInitCurrency.
Remarks:
  • The <Default> currency corresponds to the Euro. This default currency can be identified and changed using eDefaultViewCurrency.
  • The caption of the currency will be displayed beside the value if the $ sign is specified in the display mask. For example: "$999.99" will display for example in Francs: F 945.00.
Tooltip
Windows

Overview

A tooltip can be automatically displayed when hovering the edit controls (or the table columns) in order to display the entered value in a different currency.
Example:
Windows

Conversion rules in the tooltip

The tooltip displays the value of the converted control:
  • In the specified currency.
  • In the stored currency if the currency of the tooltip is the default currency and if the stored currency differs from the display currency.
  • In Euro if the currency of the tooltip is the default currency and if the stored and display currencies are identical but differ from the Euro.
  • In Franc if the currency of the tooltip is the default currency and if the stored and display currencies are identical and correspond to the Euro.
Windows

Configuring the display of tooltip

The currency used for the tooltip is chosen in the window editor in the advanced options of the Euro. This currency is selected from a list displaying the different currencies. This list contains:
  • the number identifying the currency,
  • the abbreviation of the currency according to the ISO standard,
  • the name of the country corresponding to this currency.
The last four currencies of this list are user-defined currencies: they allow choosing an additional currency created through programming with eInitCurrency.
Dual display
Windows

Overview

The dual display enables you to display the same value expressed in different currencies in two controls. The following vocabulary is used:
  • Base control: control in which the value is entered.
  • Tracker control: control displaying the value of the base control in another currency. The value displayed in the tracker control always reflects the value entered in the base control.
Remarks:
  • If the base control is an edit control, the tracker control is an edit control.
  • If the base control is a table column, the tracker control is another column of the same table.
  • A base control can be the tracker control of its own tracker control. In this case, you have the ability to enter a value in the two controls. The associated controls will be automatically updated.
Example
The "EDT_EDIT1" control is used to enter a value in Francs. It is linked to the "PriceBT" item. Its tracker control is the "EDT_EDIT2" control. The values entered in the EDT_EDIT1 control will be automatically converted into Euros in the EDT_EDIT2 control.
The "EDT_EDIT2" control is used to enter a value in Euros. Its control for dual display is the "EDT_EDIT1" control. The values entered in the "EDT_EDIT2" control will be automatically converted into Francs in the "EDT_EDIT1" control.
In this example, the prices will be saved in Francs in the HFSQL data file.
Windows

Operating mode of dual display for an edit control

A tracker edit control is updated:
  • When the user enters a value in the base control.
  • When assigning the value of the base control through programming.
  • When using FileToScreen if the tracker control is not linked to an HFSQL item.
Special case: The conversion is not performed if the tracker control is linked to an item of an HFSQL data file.
Windows

Operating mode of dual display for a table column

Most of the time, the column used for dual display corresponds to a calculated column: its operating mode is similar to the one of calculated columns.
For a Table control based on a data file, the column that allows for dual display must be initialized in the display code of a table row. The code used can be for example:
// -- Displaying a Table row
COL_PriceEuro = eToEuro(COL_UPBT, 1)
with:
  • COL_PriceEuro: name of the column displaying the value in Euros.
  • COL_UPBT: name of the column linked to an item of an HFSQL file, displaying the value in Francs.
The column used for dual display is automatically updated:
  • when the base column is modified by the user,
  • when the base column is modified through programming.
Reminder: The functions to read or display a data file in the Table control have no effect on a calculated column.
Windows

Advanced configuration

"Display the rounding difference in the status bar" is available for Edit controls and columns of Table controls.
This option is used to display the rounding difference that occurs when converting the value between the base control and the tracker control. This rounding difference will be expressed in the weakest of the two currencies: for this currency, its lower unit has the smallest value.
For example, 1 centime in French Francs is weaker than 1 cent in Euros: the difference will be expressed in French Francs.
Remark: The currency used for the rounding difference will be displayed in the message. This rounding difference can also be returned by eRoundDifference.
Windows

Configuring the dual display

The tracker control is selected in the window editor or in the report editor in the characteristics of the control. WINDEV automatically propposes the list of "Currency + Euro" controls found in the current window or report.
Related Examples:
Euro calculator Unit examples (WINDEV): Euro calculator
[ + ] Handling the European currencies in relation to the Euro:
- Convert an amount into Euros
- Convert an amount from Euros into another national currency
- Perform operations on currency values
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/22/2023

Send a report | Local help