[resolved] Suppress Exponent in a double format

Highlighted
One Star

[resolved] Suppress Exponent in a double format

Hi everyone,
I need to obtain a double which has no exponent in an csv file. The file is from a tfileOutputdelimited.
In my files I got these things : 3.53435E12 and I need 353435000000.
And I also need to keep the decimal if there are any.
I tried a few things on the tmap but I could'nt find any solutions.
Someone has any idea ?

Thanks,

Accepted Solutions
Highlighted
Community Manager

Re: [resolved] Suppress Exponent in a double format

Hello
I tested it on tJava:
	double d = 3.53435E12;
java.text.DecimalFormat df = new java.text.DecimalFormat("#.#");
String s=df.format(d);
System.out.println("d = " + s);

result:
tarting job forum7601 at 10:13 04/08/2009.
d = 3534350000000
Job forum7601 ended at 10:13 04/08/2009.

Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

View solution in original post


All Replies
Highlighted
Community Manager

Re: [resolved] Suppress Exponent in a double format

Hello
I tested it on tJava:
	double d = 3.53435E12;
java.text.DecimalFormat df = new java.text.DecimalFormat("#.#");
String s=df.format(d);
System.out.println("d = " + s);

result:
tarting job forum7601 at 10:13 04/08/2009.
d = 3534350000000
Job forum7601 ended at 10:13 04/08/2009.

Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

View solution in original post

Highlighted
One Star

Re: [resolved] Suppress Exponent in a double format

thank you for the answer
Highlighted

Re: [resolved] Suppress Exponent in a double format

And how to achieve it in tMap?
Highlighted
Community Manager

Re: [resolved] Suppress Exponent in a double format

And how to achieve it in tMap?

Create a method in a routine to do it, the method requires an input parameter, you just need to call the routine and pass the incoming data as input parameter on tMap.
----------------------------------------------------------
Talend | Data Agility for Modern Business

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog