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:

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

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

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.

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.

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)]]

Parameter 1: Number (required)

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

Example

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

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.