Kissflow DocsHelp center

Number and currency expressions

Number and currency expressions are similar. However, many functions, methods, and operators may not work when evaluating numbers and currencies.

BasicEnterprise

Number and currency expressions are similar. However, many functions, methods, and operators may not work when evaluating numbers and currencies.

If you use multiple currency fields, make sure they are the same type. Rating and slider fields can be used as number fields in expressions. 

Example used

We’ll use these sample fields in the expressions below.

FieldIDTypeValue
num1Number10
num2Number22.45
cur1Currency$10

Number and currency functions

Functions go at the start of the expression. 

FunctionData typeDescriptionSyntaxOutput
RandNumberGenerates a random number.Rand()0.449218421
RandBetweenNumberGenerates a random number between two values.RandBetween(1, 10)4
ModNumber or CurrencyShows the remainder when the dividend is divided by the divisor.
If the dividend is a currency, the result is also a currency.
Mod(num1, 3)
Mod(cur1, 3)
1
$1
MinNumber or CurrencyShows the minimum value of a set of numbers.Min(num1, num2)10
MaxNumber or CurrencyShows the maximum value of a set of numbers.Max(num1, num2)22.45

Methods

Methods come after the field ID and are called up with a dot operator. 

FunctionDescriptionSyntaxOutput
roundRounds a number up or down.
Add the number of decimal places you want.
num2.round()
num2.round(1)
22
22.5
roundupAlways rounds a number up.
Add the number of decimal places you want.
num2.roundup()
num2.roundup(1)
23
22.5
rounddownAlways round a number down.
Add the number of decimal places you want.
num2.rounddown()
num2.rounddown(1)
22
22.4
ceilRounds up a number to the nearest multiple of the unit given.
If no value is given, it is treated as 1.
num2.ceil(5)25
floorRounds down a number to the nearest multiple of the unit given.num2.floor(5)20
absShows the absolute value of a number.num2.abs()22.45
codeShows the currency code in a text field.cur1.code()USD

Operators

There are five arithmetic operators in Kissflow: 

  • Addition (+)
  • Subtraction (-)
  • Multiplication (*)
  • Division (/)
  • Exponents (^)

Expressions with arithmetic operators can use integers or fields. 

Using operators

Here are all the ways that you can evaluate fields.

Field 1Field 2OperatorResulting type
NumberNumber+, -, *, /Number
NumberInteger+, -, *, /, ^Number
CurrencyCurrency (same)+, -Currency
CurrencyNumber/Integer*, /Currency

Converting data types

Here are some ways to convert data types using numbers.

NameDescriptionSyntaxOutput
valueConverts a currency value to a number value.cur1.value()10
NumberConverts a text value to a number.
E.g. the value of text1 is “10”.
Number(text1)10
CurrencyConverts a number value to a specific currency.Currency(10, "GBP")£ 10
Currency from textThis function converts a string value to a specified currency. You should include a space between the integer value and the currency code as part of the syntax.
Note:
This function is only supported in the integration configuration forms.
currencyFromText("10 USD")$ 10
convertConverts one currency into another type with a static exchange rate.1cur1.convert(.90, “EUR”)EUR €9.00

1. To use real-time exchange rates, use a remote lookup field.

MethodSyntaxInput typeOutput typeExplanation
extractNumberRemotelookup_Fieldname.extractNumber
(<path,<index>)
Remotelookup_Fieldname: JSON OBJECT<path>: TEXT (valid json path)<index>: NUMBERLIST{NUMBER}NUMBERExtracts and returns a number array from the JSON object as filtered by the provided json path. If the index is provided then the number in the particular index is extracted.

On this page