Addition (+)
Airkit supports the standard addition operator +
. It is used to add Number and Currency values as well as combine Text values into a single string and List types into a single List.
Examples
Adding Numbers
The following example shows how the addition operator is used to combine the Numbers 2 and 3 together. Note that it returns a another Number: 5, the sum 2 and 3:
Adding Currency
The addition operator can be used to add Currencies provided the Currency values being added have the same currency code. For instance, say you have two Currency values, currency_1
and currency_2
, defined as follows:
currency_1
and currency_2
both represent money in US dollars, so they can be combined using the addition operator:
Currency values cannot be added if they do not have matching currency codes. For example, say there is a third Currency value, currency_3
, in Euros rather than dollars, defined as follows:
Attempting to use the addition operator to add currency_3
to currency_2
will result in an error, because the addition operator cannot add euros and US dollars:
Adding Text
The following example shows how the addition operator is used to combine the strings "abc" and "def". Note that it returns another string: "abc" and "def" concatenated together:
When adding strings together, the addition operator behaves analogously to the CONCAT function.
Adding Lists
The following example shows how the addition operator is used to combine the Lists [1, 2, 3] and [a, b, c]. Note that it returns another List:
Last updated