Suppressing leading Zero's of Decimal Data type
Moderators: chulett, rschirm, roy
Suppressing leading Zero's of Decimal Data type
I was wondering if there is a function that could drop all the leading zeros off of a Decimal data type.
When? When writing to a sequential file? When loading into a database? Why do you have a problem with leading zeroes? Is the Peek stage confusing you?[/url]
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
yes the decimal data type ammends leading and trailing 0 to fit the exact length as you specifybensonian wrote:Actually i was doing a division operator on a varchar data type and even used type conversion function to change it to decimal data type. StringtoDecimal(). Still in the sequential file i could see leading zeroes. My decimal data type is of length 12 scale 8.
but while writing it to Database it is removed
but when you write it to sequential file leading and trailing zeros will be there
but that will not make any difference while performing calculations
Since float and double doesn't ammends leading and trailing 0
You may convert the output to float or double from decimal
Just a suggestion, You may find some other way also.
Regards,
Priyadarshi Kunal
Genius may have its limitations, but stupidity is not thus handicapped.
Genius may have its limitations, but stupidity is not thus handicapped.