Base 10 Logaritm

<< Click to Display Table of Contents >>

Navigation:  Bizagi Studio > Process wizard > Business Rules > Business rules examples > Perform Math operations >

Base 10 Logaritm

Overview

This function returns the base 10 logarithm of a number.

 

CHelper.Math.Log10(Number)

 

The parameter of this function can be defined as an XPath, variable or number.

 

Considerations

Input parameter must be double.

The supported attribute types to use as input XPath parameter (or XPaths stored in variables) are: integer, currency, float, real.

The function returns error if evaluates an input parameter that is less than or equal to 0.

The function returns error if an input array is either too long or undefined.

Use the IsNaN function to validate the parameter is a number.

 

Example

A Bank offers multiple products to its customers. When a customer is interested in a CD (Certificate of deposit) it is common that they ask for the necessary time (term) the money has to be invested to achieve an expected amount under the offered interest rate.  

This term can be calculated using the following formula:

 

Math9

 

Where n is the necessary term (in months) the invested amount Po needs to remain invested to achieve the desired amount P at the interest rate i.

 

To perform this calculation in Bizagi you can use the Log10 function. This function receives a number as parameter:

 

Math24

 

//Obtain the parameters of the formula in variables

Po = <CDRequest.InvestedAmount>;

P = <CDRequest.DesiredAmount>;

i = <CDRequest.OfferedInterestRate>;

//Apply the formula to obtain the required term

<CDRequest.RequiredTerm> = (CHelper.Math.Log10(P / Po) / CHelper.Math.Log10(1+i));