Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hello all,
i want to convert BigDecimal to integer ,
I am using Integer.parseInt(row.columnname)
but its not working........
please provide solution for this.
Hello,
This topic is quite old but I will answer it because people (like me) may look for an answer and find this topic.
Here is the solution I found : you can make a routine such as :
public static Integer Integer(BigDecimal bd) {
return bd.intValue();
}
Then you can call this routine in Tmap or anywhere you need to convert Bigdecimal to Integer by typing {Routine_Name}.Integer({BigDecimal_Value})
Make sure the BigDecimal number you want to convert is convertible to Integer tho.
I'm quite new on Talend so maybe there is a better solution, but Routine is a very powerful tool that can solve many problems.
Cheers