1 51 package org.apache.fop.fo.expr; 52 53 import org.apache.fop.fo.Property; 54 import org.apache.fop.fo.NumberProperty; 55 56 57 class FloorFunction extends FunctionBase { 58 59 public int nbArgs() { 60 return 1; 61 } 62 63 public Property eval(Property[] args, 64 PropertyInfo pInfo) throws PropertyException { 65 Number dbl = args[0].getNumber(); 66 if (dbl == null) 67 throw new PropertyException("Non number operand to floor function"); 68 return new NumberProperty(Math.floor(dbl.doubleValue())); 69 } 70 71 } 72 | Popular Tags |