flowbit

How to use math expressions

- Introduction

- Basic Math

- Logic

- Functions

Introduction

How Flowbit Calculates

You can instruct Flowbit to calculate math expressions for you by enclosing them in ${}. For example, if you would like to figure out what 10049 times 74 is, you can type in the expression ${10049*74} in the form editor. Tapping the "Play" button shows you the result.

Using References

You can also refer values from other parts of your form. To refer values, just use the field identifier, which appears to the left of the value. For example, below we refer a value by using the identifier s1.c1.

Now let's learn what else Flowbit can do

Basic Math

Arithmetic

Flowbit can perform arithmetic for you. Here is a list of examples.

Addition +
    ${100+1} gives 101

Subtraction -
    ${100-1} gives 99

Multiplication *
    ${100*2} gives 200

Division /
    ${100/10} gives 10

Remainder %
    ${10%6} gives 4

Logic

Comparing Numbers

This is how you can compare numbers in Flowbit.

Equals ==, eq
    ${(1+2)==(1+1+1)} gives true

Not Equals !=, ne
    ${(1+2)!=(1+1+1)} gives false
    ${(1+2)!=(1+1+2)} gives true

Less than <, lt
    ${1<(1+2)} gives true

Greater than >, gt
    ${1>(1+2)} gives false

Less than or equal to <=, le
    ${1<=(1+2)} gives true

Greater than or equal to >=, ge
    ${1>=(1+2)} gives false

Logical

Flowbit can perform logical operations for you.

Logical AND -- &&, and (when you want to check that all conditions are true)
    ${(1<2) and (3<2)} gives false
    ${(1<2) && (3<4)} gives true

Logical OR -- ||, or (when you want to check one or more condition is true)
    ${(1<2) or (3<2)} gives true
    ${(1<2) || (3<4)} gives true

Logical NOT -- !, not (when you want to check for the opposite of a condition)
    ${not(1<2)} gives false
    ${!(2>3)} gives true

Functions

Using functions

Sum -- $sum{}
    $sum{1,2,3,4,5} gives 15

Average -- $avg{}
    $avg{1,2,3,4,5} gives 3

Power -- $pow{}
    $pow{10,3} gives 1000

Minimum -- $min{}
    $min{1,2,3,4,5} gives 1

Maximum -- $max{}
    $max{1,2,3,4,5} gives 5

Format to Local Currency -- $fmt_curr{}
    $fmt_curr{10/3} gives $3.33 in United States
    $fmt_curr{10/3} gives £3.33 in United Kingdom

Percent -- $percent{}
    $percent{1/3} gives 33%
    $percent{1/3,2} gives 33.33%

Sine -- $sin{}, $asin{}
    $sin{90} gives 1.0
    $asin{1} gives 90.0

Cosine -- $cos{}, $acos{}
    $cos{90} gives 0.0
    $acos{0} gives 90.0

Tangent -- $tan{}, $atan{}
    $tan{45} gives 1.0
    $atan{1} gives 45.0

Pi -- $pi{}
    $pi{} gives 3.141592653589793

Exponential -- $exp{}
    $exp{1} gives 2.718281828459046

Lograthmic -- $ln{}
    $ln{1} gives 0

More functions to follow please keep checking in or follow us on Facebook or Google+

You learned how to use mathematical expressions in Flowbit

Most Excellent!

This was last modified on June 21, 2015.


HOME