LL.bindClass(“java.math.BigDecimal”);
LL.bindClass(“java.math.BigDecimal”);
LL.bindClass(“java.math.RoundingMode”);
LL.bindClass(“java.math.MathContext”);
var a =3;
var b = RoundingMode.HALF_UP;
var c = new MathContext(a,b);
var d = new BigDecimal($cpu_total-$cpu_usage);
d.round(c);
i set this code to item’s binding (Label), but only shows “undefined”or”true”,”false”.
why?
]]>
< ![CDATA[
Maybe add :
return d.toString();
At the end of your binding script?
See http://stackoverflow.com/questions/13900204/bigdecimal-to-string
]]>
< ![CDATA[
Benoît de Chezelles Thanks!
]]>
< ![CDATA[
Masaoka Taro it always a negative number
$cpu_total is not an existing value
]]>
< ![CDATA[
Bruno-Isa LAMOUR-ARNOULD
Sorry. i must be ashamed…
$cpu_total is my type error…lol
]]>
< ![CDATA[
Masaoka Taro lol
]]>