
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When i try to convert from bigdecimal to double , it gets converted to exponential automatically. how to avoid it.
Im trying to convert this bigdecimal "456456456456456" to double using this expression in tmap
row1.amount!=null?row1.amount.doubleValue():0 . I get 4.56456456456456E14 as the result . what should i do convert as it is to 456456456456456 .
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you are writing to a file, change your column to a String and use this code to convert it....
row1.amount!=null?row1.amount.toPlainString():"0"

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The numbers are the same. It is just represented using scientific notation. Are you printing this out? Do you need this printed without the scientific notation?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Rhall,
When i output in file using tfileoutputdelmited , i get the exponential value . i need it in the same format without exponential .

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Im not sure how to do that . Can you help me

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you are writing to a file, change your column to a String and use this code to convert it....
row1.amount!=null?row1.amount.toPlainString():"0"

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks rhall , Is there any way after reading the file we could chenage that type of the field to bigdecimal or double ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you are reading a flat file ALL fields are essentially Strings. The Talend components will use the schema you create to convert on reading the data

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
But what if I dont want to change the data type of the field to string. Is there any other alternative for this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you are writing to a flat file, the conversion of your column data is implicitly converted to a String. Flat file data is a String. If you are loading to a target which is able to comprehend different data types, then the formatting of those types will be configured within the target.
