PC SOFT

WINDEV的在线文档

  • 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 the 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
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系:info@cn.windev.com
产品
WinDevWebDev-服务器代码WebDev-浏览器代码WinDev Mobile报表和查询
平台
WindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPad
语言
JavaPHPAjax用户代码(MCU)外部语言
数据库
HFSQLHFSQL Client/Server存储过程HF 5.5OLE DBODBC本地访问

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:

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 ..货币记忆.

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 货币初始化货币.

Note: The <Default> currency corresponds to the Euro. This default currency can be retrieved and modified by programming with 货币存储默认值.

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 ..货币显示.

WinDevWindows

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 货币初始化货币.

Notes:

  • The <Default> currency corresponds to the Euro. This default currency can be retrieved and modified by programming with 货币默认值.
  • 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
WinDevWindows

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:

WinDevWindows

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.

WinDevWindows

Configuring the display of the 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 货币初始化货币.

Dual display
WinDevWindows

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.

WinDevWindows

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 数据库表填充到屏幕 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.

WinDevWindows

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 the 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欧元货币转换为欧元COL_UPBT1

where:
  • 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.

WinDevWindows

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 货币不同近似值.

WinDevWindows

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.