18 package org.turro.zkoss.input;
20 import org.turro.script.Script;
21 import org.zkoss.zk.ui.WrongValueException;
22 import org.zkoss.zul.Textbox;
30 private String format;
32 public Object
getNumber() throws WrongValueException {
33 return new Script().evalToDouble(getText());
36 public Object
getNumber(
int precision)
throws WrongValueException {
37 return new Script().evalToDouble(getText(), precision);
42 if(n instanceof Number) {
43 return ((Number) n).doubleValue();
48 public void setValue(Object value)
throws WrongValueException {
54 return Script.formatInput(
new Script().evalToDouble(value), format ==
null ?
"0.########" : format);
59 return Script.formatInput(value, format ==
null ?
"0.########" : format);