Calculator Builder

EQUATION / FORMULA

To calculate the result, you must use the variables in the Formula field

  • Variable x[] – the variable is used for the field that takes part in the calculation
  • Variable y[] – variable for displaying the result
y[1] = x[1] + x[2];

y[1] = x[1] - x[2];

y[1] = x[1] * x[2];

y[1] = x[1] / x[2];

Formula with additional variables

You can use the additional variables in the formula field to facilitate writing the formula and displaying the result. For Example, Formula Monthly payment for Loan:

let r = x[2] / 1200;
let A = x[1];
let N = x[3];

let result = ( r * A ) / ( 1 - Math.pow((1+r), -N));
y[1] = roundVal(result, 2);

roundVal(val, decimals) – function for rounding a number. The first parameter (val) is the number to be rounded, and the second parameter (decimals) is the number of numbers after the decimal point.

Сonditional formula

You can use complex structures to calculate the results. the ability to use the following comparison operators:

  • less
  • more
  • ==  equal

For Example:


if( x[1] < 100 ) {
    y[1] = x[2] * 2;
} else if ( x[1] < 200 ) {
    y[1] = x[2] * 3;
} else {
    y[1] = x[2] * 4;
}