PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

  • Overview
  • Stored currency
  • Overview
  • Configuring the stored currency
  • Input currency and 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/iPadApple WatchUniversal Windows 10 AppWindows Mobile
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 chosen via the "Input/Display currency". The conversion will be automatically performed.
The stored currency associated with a control can be modified by 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 you to choose an additional currency created by programming with eInitCurrency.
Note: The <Default> currency corresponds to the Euro. This default currency can be retrieved and modified by programming with eDefaultMemCurrency.
Input currency and 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 modified by programming with ..DisplayCurrency.
WINDEVWINDEV MobileWindowsWindows Mobile

Advanced configuration

Some advanced parameters can be used for an edit control and for a table column:
  • Currency modifiable via a popup menu: The user will have the ability to choose the display currency via a popup menu. This popup menu presents the result of the conversion for the value entered in the different currencies. The popup menu only displays the currencies whose exchange rate differs 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 you to choose an additional currency created by programming with eInitCurrency.
Notes:
  • The <Default> currency corresponds to the Euro. This default currency can be retrieved and modified by programming with 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
WINDEVWINDEV MobileWindowsWindows Mobile

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:
WINDEVWINDEV MobileWindowsWindows Mobile

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.
WINDEVWINDEV MobileWindowsWindows Mobile

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 you to choose an additional currency, created by programming with eInitCurrency.
Dual display
WINDEVWINDEV MobileWindowsWindows Mobile

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.
Notes:
  • 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.
WINDEVWINDEV MobileWindowsWindows Mobile

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 by programming.
  • When using FileToScreen if the tracker control is not linked to a HFSQL item.
Special case: The conversion is not performed if the tracker control is linked to an item of a HFSQL data file.
WINDEVWINDEV MobileWindowsWindows Mobile

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 browsing table, the column used 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 a 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 by programming.
Reminder: The functions used to read or display a file in the table have no effect on a calculated column.
WINDEVWINDEV MobileWindowsWindows Mobile

Advanced configuration

Display the rounding difference in the status bar is available for the edit controls and for the table columns.
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.
Note: The currency used for the rounding difference will be displayed in the message. This rounding difference can also be returned by eRoundDifference.
WINDEVWINDEV MobileWindowsWindows Mobile

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 Mobile): Euro calculator
[ + ] Handling the European currencies in relation to the Euro. This example is used to:
- Convert an amount into Euros
- Convert an amount from Euros into another national currerncy
- Perform operations on currency values
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment