am getting exponential in json ouput

Nine Stars

am getting exponential in json ouput

Hello all

 

When am writing to the json from csv 

 

the data in the csv is data : 39400100000000, but when the data is populated in the json am getting this way "data": "3.94001E+13"

 

How to rectify the issue

 

And my data type is string 

 

in the output it is expected in below way

"data": "39400100000000"

 

Thanks In Advance

Manish


Accepted Solutions
Fifteen Stars TRF
Fifteen Stars

Re: am getting exponential in json ouput

Change input datatype to String or use the appropriate conversion Double to String using a tJavaRow:

DecimalFormat df1 = new DecimalFormat("#");
output_row.data = input_row.data != null ? df1.format(input_row.data):null;

TRF

All Replies
Fifteen Stars TRF
Fifteen Stars

Re: am getting exponential in json ouput

Change input datatype to String or use the appropriate conversion Double to String using a tJavaRow:

DecimalFormat df1 = new DecimalFormat("#");
output_row.data = input_row.data != null ? df1.format(input_row.data):null;

TRF
Nine Stars

Re: am getting exponential in json ouput

@TRF thanks it worked

2019 GARNER 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

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch 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