Four Stars

Handling Exponent Values in tMap Component

Hi All/Shong,

 

I have seen your post on how to handle the exponent values in Talend writing a peace of code in java. But how to implement in tMap was not clear or undable to underastnd how to write a method and creating a variable to assign the values in runtime and trying to implement the same for ‘Amount’ field from source.

 

Can you please help me out with a peace of generic code or function in Talend, where I can use directly that code and get the result.

 

Note: I'm not expert in Jave, if need any method or creating Variable for it also, please help me step by step.

 

Amount field == ‘3.53435E-12’

 

import java.text.DecimalFormat;

double d = <Amount Field>;

java.text.DecimalFormat df = new java.text.DecimalFormat("#.#");

String s=df.format(d);

System.out.println("d   =   " + s);

 

Thanks in anticipation!

 

Regards,

T

1 REPLY
Community Manager

Re: Handling Exponent Values in tMap Component

Hi nthogiti Please refer to this KB article about how to create a routine and call in on tMap. https://help.talend.com/pages/viewpage.action?pageId=190513247 Follows the steps to create a routine to do the transformation. Let me know if you are not able to achieve it, give us an example of your data, and what are your expected output. Regards Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business