Decimal values Getting rounded
Moderators: chulett, rschirm, roy
Decimal values Getting rounded
Hi
In my source table i have a column "quantity" which has data type "real" having length as 7 . say for example one value is 12.76378682376 , when i load it directly into the database table its getting loaded fine . but i have to follow a few steps before so i am loading it into a dataset and then in the next step into the database
the problem in this is when i am loading it into a dataset the value is getting rounded to 3 decimal places eg:12.764 for the above input value
i have played with different data types to get the full value but couldnt
Please advice over this
Thanks
In my source table i have a column "quantity" which has data type "real" having length as 7 . say for example one value is 12.76378682376 , when i load it directly into the database table its getting loaded fine . but i have to follow a few steps before so i am loading it into a dataset and then in the next step into the database
the problem in this is when i am loading it into a dataset the value is getting rounded to 3 decimal places eg:12.764 for the above input value
i have played with different data types to get the full value but couldnt
Please advice over this
Thanks
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Is it really rounding into the Data Set, or is it merely that the data browser (View Data) that is doing the rounding? If you move the data from the Data Set into a table or text file, are the data complete?
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.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
record
( Part_ID: string[max=255];
Cust_ID: string[max=50];
Cust_ASM: string[max=50];
Cust_GSM: string[max=50];
UNIT: sfloat;
REVENUE: sfloat;
UNIT_EXP: sfloat;
CREATE_DATE: timestamp;
CURRENT_FLAG: string[max=1];
T_Date: timestamp;
)
The source column Quantity is getting divided into 3 columns Unit,Revenue,Unit_Exp
( Part_ID: string[max=255];
Cust_ID: string[max=50];
Cust_ASM: string[max=50];
Cust_GSM: string[max=50];
UNIT: sfloat;
REVENUE: sfloat;
UNIT_EXP: sfloat;
CREATE_DATE: timestamp;
CURRENT_FLAG: string[max=1];
T_Date: timestamp;
)
The source column Quantity is getting divided into 3 columns Unit,Revenue,Unit_Exp
how did u resolved?
Hi aceflyer,
Have u got the solution for this,if u remeber just tell me how did u achieve this?since i am having same issue..
Have u got the solution for this,if u remeber just tell me how did u achieve this?since i am having same issue..
Thanx&Regards
scorpion
scorpion
Can you try this way?
Multiply the field by 10000 (say x) or some other value and try to store in some datatype.
when you reterive, divide the field by the same number (x) .
I do agree that this will have negative impact on your performance?
If you find any other better solution, do post it..
Thanks,
Savis
Multiply the field by 10000 (say x) or some other value and try to store in some datatype.
when you reterive, divide the field by the same number (x) .
I do agree that this will have negative impact on your performance?
If you find any other better solution, do post it..
Thanks,
Savis