Wednesday, September 16, 2015

How to round off decimal to whole number

To get the ceiling value:

4143.77 to 4144

In a tmap


var1=java.lang.Math.ceil((double)Double.parseDouble(column))


when you do this the value will come out as

4144.0


to remove the trailing ".0" use below function:

(int) Math.round(Var.var1)