Hi all,
Please give me a solution regarding this.
I have a file containg values as below
real_daily_return
--------------------
-5.41114562-e05
-4.98887625-e03
---------------------
I want to convert this data having double data type to data having decimal datatype.
This works fine for those numbers with an exponent less than 5 e.g. -1.09909222273045E-03.
Those with an exponent of 5 remain unconverted e.g. -5.41150924939712E-05
So can you suggest me what is the problem here.
Convert fields containing exponential values to decimal
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
They ARE converted; the View Data mechanism converts them back to scientific notation if they are very small or very large.
Try writing to a database table with the column specified as Decimal with sufficiently large precision and scale.
When writing to a text file (recall that text files don't have data types, only text) try experimenting with the precision and scale figures. However, I believe there's an inbuilt rule to convert to scientific notation when there are four or more zeroes immediately following the decimal place.
Try writing to a database table with the column specified as Decimal with sufficiently large precision and scale.
When writing to a text file (recall that text files don't have data types, only text) try experimenting with the precision and scale figures. However, I believe there's an inbuilt rule to convert to scientific notation when there are four or more zeroes immediately following the decimal place.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Hi,
Both my source and target is sequential file.
For the source I have defined that partucular column as double
and
for the target I have defined that column as decimal.
up to 4 th exponential it is working fine.
Ray,
Can you suggest me for more than 4th exponential what scentific notation I should use here.
Is it applicable for both sequential file and database table.
Both my source and target is sequential file.
For the source I have defined that partucular column as double
and
for the target I have defined that column as decimal.
up to 4 th exponential it is working fine.
Ray,
Can you suggest me for more than 4th exponential what scentific notation I should use here.
Is it applicable for both sequential file and database table.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
What part of that was unclear?ray.wurlod wrote:I believe there's an inbuilt rule to convert to scientific notation when there are four or more zeroes immediately following the decimal place.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.