I'm trying to evaluate the expression 2.3% of value and I got invalid
result:
My code is follow:
BigDecimal bd = new BigDecimal("325");
JexlEngine jexl = new JexlEngine();
String expr = "2.3*SO/100";
JexlContext jc = new MapContext();
jc.set("SO", bd);
Object evaluate = jexl.createExpression(expr).evaluate(jc);
System.out.println(evaluate);
produce the result: 7.474999999999999 which is incorrect.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]