Class BirtMath
BirtMath.add
This function returns the sum of two numbers.
Number object. The first number to use in the calculation.
The second number to use in the calculation.
Number object. The number that results from adding n1 and n2.
The following example returns the sum of values in the SalesTotal and Shipping fields:
BirtMath.ceiling
This function rounds a number up, away from 0, to the nearest specified multiple.
Number object. The number to round up.
Number object. The multiple to round n to.
If the Price value is 20.52, the expression returns 20.55.
The following expression rounds prices up to the nearest dime:
The following expression rounds prices up to the nearest dollar:
If the Price value is 20.30, the expression returns 21.
BirtMath.divide
This function returns the result of dividing one number by another.
Number object. The number to be divided.
Number object. The number by which dividend is divided.
Number object. A number that results from dividing dividend by divisor.
The following example shows the results of dividing specific numbers:
BirtMath.mod
This function returns the remainder after a number is divided by a divisor.
Number object. The number to be divided.
Number object. The number by which the first number is divided. You must specify a non-zero number.
The remainder after number is divided by divisor.
The following examples shows the results that the function returns for specific numbers:
BirtMath.multiply
This function returns the multiplication of two numbers.
Number object. The first number to use in the calculation.
Number object. The second number to use in the calculation.
Number object. A number that results from multiplying n1 and n2.
BirtMath.round
This function rounds a number to a specified number of digits.
Number object. The number to round.
Number object. A number rounded to a specified number of digits.
The following examples shows the results that the function returns for specific numbers:
The following example rounds the values in the PriceEstimate field to return an integer:
BirtMath.roundDown
This function rounds a number down to a specified number of digits.
Number object. The number to round.
Number object. A number rounded down to a specified number of digits.
The following examples shows the results that the function returns for specific numbers:
The following example rounds down the values in the PriceEstimate field to return an integer:
BirtMath.roundUp
This function rounds a number up to a specified number of digits.
Number object. The number to round up.
Number object. A number rounded up to a specified number of digits.
The following examples shows the results that the function returns for specific numbers:
The following example rounds up the values in the PriceEstimate field to return an integer:
BirtMath.safeDivide
Number object. The number to be divided.
Number object. The number by which dividend is divided.
Object. The value to return when divisor is zero.
Number object. Number object. A number that results from dividing dividend by divisor.
The following example shows the results that the function returns for specific numbers:
BirtMath.subtract
This function returns the result of subtracting one number from another.
Number object. The number from which to subtract.
Number object. The number to subtract from n1.
Number object. A number that results from subtracting n2 from n1.
The following example shows the results of subtracting specific numbers:
(c) Copyright Actuate Corporation 2013 |