Math functions


Standard Syntax:
     <%@ taglib prefix="math" uri="http://jsftools.logikdev.com/math" %>

XML Syntax:
     <anyxmlelement xmlns:math="http://jsftools.logikdev.com/math" />

JSF Tools 0.3 Math functions library

Tag Library Information
Display NameMath functions
Version0.3
Short Namemath
URIhttp://jsftools.logikdev.com/math
 

Function Summary
java.lang.Numberabs( java.lang.Object)Returns the absolute value of the number.
java.lang.Numberadd( java.lang.Object[])Returns the sum of the numbers.

Other functions available:

java.lang.Number add(java.lang.Object, java.lang.Object)

Examples:
 ${math:add(numbers)
${math:add(number1, number2)}
java.lang.Integerceil( java.lang.Object)Returns the smallest integer that is not less than the given number.
java.lang.Numberdiv( java.lang.Object[])Returns the quotient of the numbers.

Other functions available:

java.lang.Number div(java.lang.Object, java.lang.Object)

Examples:
 ${math:div(numbers)
${math:div(number1, number2)}
java.lang.Integerfloor( java.lang.Object)Returns the integer portion of the number.
java.lang.NumbergetAverage( java.util.Collection)Returns the average of the values.

Other functions available:

java.lang.Number getAverage(java.util.Collection, java.lang.String)
java.lang.Number getAverage(java.lang.Double[])
java.lang.Number getAverage(java.lang.Long[])
java.lang.Number getAverage(java.lang.Object[])
java.lang.Number getAverage(java.lang.Object[], java.lang.String)

Examples:
 ${math:getAverage(collection)}
${math:getAverage(collection, field)}
${math:getAverage(values)}
${math:getAverage(values)}
${math:getAverage(array)}
${math:getAverage(array, field)}
java.lang.DoublegetRandom( )Returns a pseudo-random Double greater than or equal to 0.0 and less than 1.0.
java.lang.NumbergetTotal( java.util.Collection)Returns the sum of the values.

Other functions available:

java.lang.Number getTotal(java.util.Collection, java.lang.String)
java.lang.Number getTotal(java.lang.Double[])
java.lang.Number getTotal(java.lang.Long[])
java.lang.Number getTotal(java.lang.Object[])
java.lang.Number getTotal(java.lang.Object[], java.lang.String)

Examples:
 ${math:getTotal(collection)}
${math:getTotal(collection, field)}
${math:getTotal(values)}
${math:getTotal(values)}
${math:getTotal(array)}
${math:getTotal(array, field)}
java.lang.Numberidiv( java.lang.Object, java.lang.Object)Returns the result of performing integer division on the operands.
java.lang.Numbermax( java.lang.Object[])Returns the largest of the numbers.

Other functions available:

java.lang.Number max(java.lang.Object, java.lang.Object)

Examples:
 ${math:max(numbers)
${math:max(number1, number2)}
java.lang.Numbermin( java.lang.Object[])Returns the smallest of the numbers.

Other functions available:

java.lang.Number min(java.lang.Object, java.lang.Object)

Examples:
 ${math:min(numbers)
${math:min(number1, number2)}
java.lang.Integermod( java.lang.Object, java.lang.Object)Returns the result of performing integer modulus on the operands.
java.lang.Numbermul( java.lang.Object[])Returns the product of the numbers.

Other functions available:

java.lang.Number mul(java.lang.Object, java.lang.Object)

Examples:
 ${math:mul(numbers)
${math:mul(number1, number2)}
java.lang.Numberpow( java.lang.Object, java.lang.Object)Returns the first number raised to the power of the second.
java.lang.Numberrandom( java.lang.Object, java.lang.Object)Returns a pseudo-random Number greater than or equal to the first number and less than the second.
java.lang.Integerround( java.lang.Object)Returns the number rounded to the nearest whole Integer.
java.lang.DoubleroundTo( java.lang.Object, java.lang.Object)Returns the value rounded to the specified number of decimal places.
java.lang.Numbersub( java.lang.Object[])Returns the difference of the numbers (subtracted in order).

Other functions available:

java.lang.Number sub(java.lang.Object, java.lang.Object)

Examples:
 ${math:sub(numbers)
${math:sub(number1, number2)}
java.lang.DoubletoDouble( java.lang.Object)Returns a Double representation of the number.
java.lang.IntegertoInteger( java.lang.Object)Returns a Integer representation of the number.
java.lang.NumbertoNumber( java.lang.Object)Returns a Number representation of the number.
 


Java, JSP, and JavaServer Pages are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 2002-3 Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054, U.S.A. All Rights Reserved.