How to convert data from .csv file so that it could be calculated with BigDecimals from database?

I want to create a Job in Talend to transform data from .csv file using some data from a database and then incorporate into another .csv file. Some calculation is to be done on the values during transformation:
Netvalue1 / Netvalue2 * Netvalue3
Netvalue1 is taken from the .csv file, by default it is a String having an amount, like.
"43.65"

Netvalue 2 and 3 are taken from database and that BigDecimals with 4 decimal places. The result of the calculation to be rounded up to 2 decimal places.

I want to know that How to convert data from .csv file so that it could be calculated with BigDecimals from database?

When I convert any datatype to BigDecimal it loses the decimals,
Example from String: BigDecimal n = new BigDecimal("43.65") The result would always be
43
I have tried to do it with ROUND_UNNECESSARY and setScale also, but it is not relevant in this case.

Tagged:
Sign In or Register to comment.