Fixed the GREL round function.
git-svn-id: http://google-refine.googlecode.com/svn/trunk@1749 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
parent
1f12bfb409
commit
faaca5beea
@ -46,7 +46,7 @@ public class Round implements Function {
|
|||||||
|
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
|
if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
|
||||||
return ((Number) args[0]).longValue();
|
return Math.round(((Number) args[0]).doubleValue());
|
||||||
}
|
}
|
||||||
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number");
|
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user