LeadingUnit property

NumberField.LeadingUnit — Text

Represents the leading unit of the field. A leading unit is displayed before the field value when the value is not being actively edited. It is typically used for currency symbols like "$" and "€". Set the trailing unit through the TrailingUnit property.

When a new currency field is created in Calcapp Creator, a number field is created. It differs from a regular number field in that its leading unit is set to the symbol of the selected currency. Also, the minimum and maximum number of decimal places are both set to two for the field.


SWITCH(Currency, "USD", "$", "EUR", "€", "")SWITCH(Currency; "USD"; "$"; "EUR"; "€"; "")

Sets the leading unit to "$" if the value of the text drop-down field Currency is "USD", to "€" if its value is "EUR" and to a blank text string otherwise.