Hello all,
I am trying to do this the easiest way possible, I don't want to be re-inventing the wheel.
I have a decimal, like "-1,235.83" or "480.75"
For output, I would ultimately like to have
"000001235-" or "0000000480+"
There has to be an easier way other then me doing a whole pile of programming. I was looking at the FormatStr, but it wasn't going to happen for me. The best I've been able to get was
AmtDue := FORMAT(AmountDue[4],10, '<integer><sign>');
and I've tried other things like
AmtDue := FORMAT(AmountDue[4],10, '"00000;#####"<integer><sign>');
but the output is not at all what I would like to have happen. Any assistance would be very much appreciated as I can't seem to find anything to what I need in the C/Side Reference or even in many of the newsgroups that I've been reading about.
Thanks again in advance,
Kevin
0
Answers
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Thank you very much for your reply Rashed, As a result I was able to achieve my desired output. I didn't exactly use your method, but what I did use was:
AmtDue := FORMAT(AmountDue[4],10,'<Integer,9><Filler,0><sign>');
I had to use Integer, 9 because Integer, 10 bumped the sign off the end of the string.
The only problem I face now is that it doesn't always supply a sign. It just shows a sign when it is negative. And when I Stream 2 numbers side by side.. I would expect them to be
000000001+000000002-
but instead I get
000000001__000000002-
the "_" are to show that I end up with two blank spots. In the first blank spot I would like to have the "+" and where the second blank spot is I'd rather not have anything.. So that the numbers just run, one into the next.
If you have any idea's on how to tackle this problem it would be very much appreciated.
Thanks again for all your help so far.
Kevin
if dec > 0 then
text := text + '+';
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Thanks for the promptness of your reply.
That was my mistake.. I missed that, Thanks..
What do you think about taking away the gap in between numbers?
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
That was my mistake, it's been fixed now.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
I was looking for that option, but I don't know how to do that. There's no button for me to press. If you could be kind enough to let me know how to do it. I would do it.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Thanks... I've now done that. I've got a few others messages to fix up as well.