One Star

DATA TYPE CONVERSION

hi,
I am new to Talend and trying to accomplish some intermediate operations in TMAP Component. I need to convert the data types in TMAP to work through my tasks.
I need to convert from String - > Bigdecimal; Integer - > Bigdecimal ; String -> Date
Any help....
2 REPLIES
Community Manager

Re: DATA TYPE CONVERSION

Hi
1. String-->BigDecimal
new java.math.BigDecimal(row1.columnName)
2. Integer-->BigDecimal
new java.math.BigDecimal(row1.columnName)
3. String-->Date
TalendDate.parseDate("yyyy-MM-dd HH:mm:ss",row1.columnName)
If you want to know more about TalendDate.parseDate(String date_pattern, String string_of_date), go to repository-->code-->System-->TalendDate
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: DATA TYPE CONVERSION

Hi shong,
Thanks , its removed the error
But in my srouce one patricular column has negative decimal values (-0.05916667)
So in console am getting below message and in job it shows zero rows passed
help pls...