Hi,
I have a integer(4) comming into a transformer stage which I want to convert to a varchar. I cannot use a inttostring because there is no function (or is there ?).
I therfore use DecimalToString to convert to a varchar(64) however it has leading and trailing zeros i.e. 7869 comes out as 0000000007869.00000000
How can I trim this I tried to use
PRODUCT_NO= string_trim["0", begin, end](PRODUCT_NO) in a modify statement however this does not work can someone help please.
trim leading 0's from decimal
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The Data Browser puts leading and trailing zeroes on Decimal data so that you can be user that precision and scale are being handled correctly. When stored - for example in a database table - the leading and trailing zeroes are not significant. It is only an issue if you want to write to text files. In that case, change data type to VarChar.
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.