Below function is returning the output is 8.110000000000001. I want the output only upto two decimal places. i.e) 8.11
- def array = [2.16,1.34,1.32,1.25,0.65,0.48,0.42,0.26,0.14,0.06,0.03,0]
- def result = 0
- def fun = function(x){ var temp = karate.get('result'); karate.set('result', temp + x )}
- karate.forEach(array, fun)
- print result