Hi All,
I had a very simple question..
I have field of datatype Decimal (15,4)
Can I read a number value of 2774389000000 in this field?
I am trying to understand the Varchar length accepted to read the value.
Thanks
Decimal Length
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 247
- Joined: Thu Apr 27, 2006 6:38 am
- Location: Hyderabad
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Decimal(15,4) has a total of 15 significant digits. Four of these are to the right of the decimal point, which means you can have a maximum of 11 to the left of the decimal point.
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:
Your decimal definition states a total of 15 digits, 4 of which will be after the decimal point: 99999999999.9999. You can safely load any value up to a length matching the above format (17 bytes in total including decimal point and a sign).
Any value that exceeds the format definition risks being truncated (12 or more digits to the left of the decimal point, 5 or more to the right).
Value is the key word here. 1 and 0000000000000001 are different string lengths but have the same numeric value of 1--both have one significant digit.
Regards,
Any value that exceeds the format definition risks being truncated (12 or more digits to the left of the decimal point, 5 or more to the right).
Value is the key word here. 1 and 0000000000000001 are different string lengths but have the same numeric value of 1--both have one significant digit.
Regards,
- james wiles
All generalizations are false, including this one - Mark Twain.
All generalizations are false, including this one - Mark Twain.