Table of Contents

Formulas - Math

Dilyara Mukhamedgaleyeva Updated by Dilyara Mukhamedgaleyeva

Math

Formulas available:

  • Product
  • Quotient
  • Remainder
  • Subtract
  • Sum
  • ToFloat
  • ToInteger
Examples of use case of Math formulas:

Product

Apply 20% discount

Product(@price, 0.8)

Quotient

Get % of correct answers

Quotient(Product(@correctanswers,100),@maxpoints)

Remainder

Test if an integer is divisible by another number

In the formula below the @integer has the value 1128 and @number has the value 4. Since the remainder is equals to 0, it is divisible.

Remainder(@integer,@number)

Subtract

Check how much products are left in stock

Subtract(@total_items,@purchased_items)

Sum

Add +1 every time user passes through this step

Sum(@counter,1)

ToFloat

Convert an integer to a floating point number

Below is a formula where the variable @integer has the value 1015 and we want 1015.0

ToFloat(@integer)

ToInteger

Convert to only 2 decimals

Below is a formula where the variable @number has the value of 3.1415 and we only want 3.14

Quotient(ToInteger(Product(@number, 100)),100)

In case we want 1 decimal the Formula would be with 10:

Quotient(ToInteger(Product(@number, 10)),10)

How did we do?

Formulas - Regex

Formulas - Array

Contact