Template Math

General

LoanPro provides some basic functions that can be used to perform basic mathematical operations. To use one of these function, you will need to know the function name and the parameters it takes. This article will cover the names and parameters of each function and show an example of how to use each one.

The available functions are:

  • mathAdd()
  • mathSubtract()
  • mathMultiply()
  • mathDivide()
  • mathSqrt()
  • mathPow()
  • evalFormula()

Function Name: mathAdd()

Parameter 1: Number (required)

Parameter 2: Number (required)

This function lets you add two numbers together. Usually at least one of the parameters will be a variable name.

Example

[[mathAdd(‘setup-loan-amount’, ‘setup-underwriting’)]]

This will output the loan amount plus the underwriting fee. So, if the loan amount was $10,000 and the underwriting fee was $150,  this will output 10150.

Function Name: mathSubtract()

Parameter 1: Number (required)

Parameter 2: Number (required). This number will be subtracted from the other number, so if this is the larger number, the result will be negative.

This function lets you subtract one number from another. Usually at least one of the parameters will be a variable name.

Example

[[mathSubtract(‘setup-loan-amount’, ‘setup-underwriting’)]]

This will output the difference between the loan amount and the underwriting fee. So, if the loan amount was $10,000 and the underwriting fee was $150, this will output 9850.

Function Name: mathMultiply()

Parameter 1: Number (required)

Parameter 2: Number (required)

This function will let you multiply two numbers. Usually at least one of the parameters will be a variable name.

Example

[[mathMultiply(‘setup-loan-amount’, 10)]]

This will output the product of the loan amount and 10. So, if the loan amount was $10,000, this will output 100000.

Function Name: mathDivide()

Parameter 1: Number (required)

Parameter 2: Number (required). This is the number the first number will be divided by.

This function will let you divide one number by another number. Usually, at least one of the parameters will be a variable name.

Example

[[mathDivide(‘setup-loan-amount’, 10)]]

This will output the quotient of the loan amount and 10. So, if the loan amount was $10,000, this will output 1000.

Function Name: mathSqrt()

Parameter 1: Number (required)

This function will let you find the square root of a number.

Example

[[mathSqrt(‘setup-loan-amount’)]]

This will output the square root of the loan amount. So, if the loan amount was $10,000, this will output 100.

Function Name: mathPow()

Parameter 1: Number (required)

Parameter 2: Number (required). This number is the power that the first number will be raised to.

This function will raise a number to a power.

Example

[[mathPow(‘setup-loan-amount’, 2)]]

This will output the loan amount to the second power. So, if the loan amount was $10,000, this will ouput 100000000.

Function Name: evalFormula()

Parameter 1: String (required)

This function lets you evaluate a Clojure formula. You can enter the formula as a string into the function, it will be evaluated, and the result will appear in the form.

Example

[[evalFormula('(+ status-amount-due 50000 setup-loan-amount)')]]

This will output the amount past due + 50000 + the loan amount. So, if the amount due is $320.00 and the loan amount is $10,000 the output will be 60320.


How did we do?


Powered by HelpDocs (opens in a new tab)