Convert String to BigDecimal

One Star

Convert String to BigDecimal

Hi,
I have a problem writing an expression in tMap. I want to convert a field which is a String to a field which is BigDecimal.  I also need to check the content of String field - if it has "szt" then I need to send 1 and if not then I need to send the value of the field (converted to BigDecimal).
Thanks for all the suggestions because I'm stuck :/
One Star

Re: Convert String to BigDecimal

str == null ? null : (str.contains("szt") ? new BigDecimal(1) : new BigDecimal(str))
Lin LIN
Consultant BI/Talend
Synaltic Group