org.ucl.xpath.function
Class FnRound
java.lang.Object
org.ucl.xpath.function.Function
org.ucl.xpath.function.FnRound
- public class FnRound
- extends Function
Returns the number with no fractional part that is closest to the argument.
If there are two such numbers, then the one that is closest to positive infinity
is returned. More formally, fn:round(x) produces the same result as fn:floor(x+0.5).
If type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal
or xs:integer the type of the return is the same as the type of $arg. If the type
of $arg is a type derived from one of the numeric types, the type of the return is
the base numeric type.
Constructor Summary |
FnRound()
Constructor for FnRound. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FnRound
public FnRound()
- Constructor for FnRound.
evaluate
public ResultSequence evaluate(java.util.Collection args)
throws DynamicError
- Evaluate arguments.
- Specified by:
evaluate
in class Function
- Parameters:
args
- argument expressions.
- Returns:
- Result of evaluation.
- Throws:
DynamicError
- Dynamic error.
fn_round
public static ResultSequence fn_round(ResultSequence arg)
throws DynamicError
- Round operation.
- Parameters:
arg
- Result from the expressions evaluation.
- Returns:
- Result of fn:round operation.
- Throws:
DynamicError
- Dynamic error.