The function is a bit outside of my understanding. Could you maybe explain the syntax? If I can understand how it operates, I could start using it elsewhere too.
[WHEN CONDITION IS YES] if [CONDITION] else [WHEN CONDITION IS NO]
When the [CONDITION] is yes, [WHEN CONDITION IS YES] is returned, if it is no, then the [WHEN CONDITION IS NO] is returned.
Here is another example:
Number {formtext: name=number; default=100}
{="big number" if number > 10 else "small number"}
{="The number is a " & ("positive number" if number > 0 else "negative number")}