Search code examples
talend

Talend using Tmaps to convert 1M to 1000000 and 1K to 1000


So i am trying to map and string column having numeric values such as 10M and 10K in it, into another table column. But i need to map them as numeric and want to replace 10M with 10000000 and 10 with 10000. What the best way to do that. I am new at Talend so any help would be appreciated.


Solution

  • You can do in your tmap this formula :

    Relational.ISNULL(row1.col1 ) || "".equals(row1.col1 ) ? null : Integer.parseInt(StringHandling.CHANGE(StringHandling.CHANGE(row1.col1,"K","000"),"M","000000"))