AnsweredAssumed Answered

Rounding in groovy

Question asked by SteveSilveri3431 on Feb 21, 2017
Latest reply on Feb 21, 2017 by Seth Duda

In order to round in groovy I need to use the following

def d = (daysToEndDate + 1) / lastDays.days;
def n = d.toDouble();
n = n.round(3) + intMonths;

 

That works in standalone groovy, but not boomi.  Anyone know how to make this work?

 

Error is something like

 

groovy.lang.MissingMethodException: No signature of method: java.math.BigDecimal.round() is applicable for argument types: (java.lang.Integer) values: [3] Possible solutions: round(java.math.MathContext), find(), pow(int), power(java.lang.Integer), and(java.lang.Number), find(groovy.lang.Closure)      at Script1.run(Script1.groovy:109)

Outcomes