Dynamic decimals

From Version 9.5 onwards, the Decimal property of Numeric fields can be changed dynamically based on certain specific conditions.

For instance, the decimal value can be changed based on the currency of a country.

  • To implement dynamic decimals, introduce a field named AxpCurrencyDec with character data type. This field value should be decimal, field1, field2,field3…etc. The given fields will be set to the given decimal.
  •  The AxpCurrencyDec field should be a fill field based on the selection made in the currency field. i.e  the developer needs to introduce a table that will contain the information about the fields for which the decimal needs to be set based on currency selection. The table may have fields such as Tstruct name, currency, DecimalString. The decimal string can contain the value as described above.
  • The AxpCurrencyDec field can also be an expression field with value as decimal,field1,field2~decimal,field3,field4 The ~ separated string can be used to set different decimals for different fields.

Example

  • AxpCurrencyDec = 3,rate,amount means that the decimal property should be updated to 3 decimals for rate and amount fields.
  • AxpCurrencyDec = 3, rate, amount~2,rate1, amount1 means that the decimal property should be updated to 3 decimals for rate and amount fields and decimal property should be updated to 2 decimals for rate1 and amount1 fields.

Note: Maximum decimal place value should be specified in the TStruct property definition for all those fields that are defined to change the decimals dynamically in AxpCurrencyDec field value .