Scope: managed applications, mobile applications, and ordinary applications.
1. To ensure operability of a configuration in countries with a low rate of national currency, configure possibility to increase the number of digits in an integer part of numeric fields (attributes, resources, and dimensions) that contain money equivalent—money fields. Examples of money fields: Amount, Price, and Cost.
For this purpose, in metadata:
- For money fields that can contain only positive values, instead of the Number(15, 2) fixed type, use the MonetaryAmountNonNegative defined numeric type.
- For money fields that can contain negative values, use the MonetaryAmountPositiveNegative type with the cleared Nonnegative flag.
If the defined type cannot be specified (for example, as a type for a form parameter or included in a composite type), specify the numeric type of the maximum length Number (31, 2).
2. If Standard Subsystems Library is available in the configuration, do not use a wizard of the Number type to get details of the money field type. Instead, use a function that returns details based on the user-defined type.
TypeDescriptionAmount = New TypeDescription("Number", New NumberQualifiers (15,2));
TypeDescriptionAmount = CurrencyExchangeRates.MoneyFieldTypeDescription();
3. When using CAST in query texts for money fields, cast to the NUMBER(31,2) type. That way, the maximum length of an integral part equal to 29 is supported. The length of the integral part is restricted to 29 due to DB2 server support.
CAST(Т.Amount / Т.Count AS NUMBER(15,2))
CAST(Т.Amount / Т.Count AS NUMBER(31,2))
Format(Selection.DocumentAmount, "ND=15; NFD=2")