Hi,
I am sure this question will have been answered before, but i have spent an age doing searches on the topis and cannot find what i need.
This should be relatively simply, so hopefully some one can give me a quick guide please.
I have a decimal field (9999.99) which i need to write to a file. i am using the decimal to string conversion routine to convert to varchar to include in file data. the value in the field is 100.00. when i use the suppress zero option it is written to the file as 100, without this option it is written as 0100.00.
So here's the question, is it possible to suppress the leading zeros but keep the trailing ones, ie write 100.00 to the file?
Thanks as always
John Fitz
Decimal Conversion & formatting
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 72
- Joined: Tue Feb 05, 2008 4:38 am
Hi,
I had a similar issue and I think I did a TRIM after doing the decimal to String conversion. The other solution was to use the stage variables.
Use the decimal to String function. Use Field function to get the precision part and decimal part. Do a Trim on both the stage variables. Concat the stage variables in the derivation.
Do a search with Search for Author as richdhan. This was discussed before.
HTH
--Rich
I had a similar issue and I think I did a TRIM after doing the decimal to String conversion. The other solution was to use the stage variables.
Use the decimal to String function. Use Field function to get the precision part and decimal part. Do a Trim on both the stage variables. Concat the stage variables in the derivation.
Do a search with Search for Author as richdhan. This was discussed before.
HTH
--Rich
-
- Participant
- Posts: 72
- Joined: Tue Feb 05, 2008 4:38 am