Solve the problem that integers are printed as floats as far as skin parameters and

macro return values are concerned.
This commit is contained in:
hns 2003-07-01 15:10:04 +00:00
parent bc1b067cf0
commit 3d3b839395

View file

@ -611,7 +611,19 @@ public final class Skin {
return; return;
} }
} else { } else {
text = value.toString(); // do not render doubles as doubles unless
// they actually have a decimal place. This is necessary because
// all numbers are handled as Double in JavaScript.
if (value instanceof Double) {
Double d = (Double) value;
if (d.longValue() == d.doubleValue()) {
text = Long.toString(d.longValue());
} else {
text = d.toString();
}
} else {
text = value.toString();
}
} }
if ((text != null) && (text.length() > 0)) { if ((text != null) && (text.length() > 0)) {