Fmt vs DecimalToDecimal/DecimalToString

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
tracy
Participant
Posts: 47
Joined: Mon Aug 07, 2006 9:19 am

Fmt vs DecimalToDecimal/DecimalToString

Post by tracy »

I have a Decimal(11,2) that I want to add to a Sequential file in a Varchar field. For instance, I want to see "Total: 9999.99" in the Sequential file.

I'm finding that it's not always showing the 2 decimal places.

So I went searching for a way to force it to always show 2. I've seen discussions on DecimalToDecimal and DecimalToString, but I didn't get anywhere with those.

I finally stumbled upon Fmt(number, 'R2') which seems to be doing the trick. This seems so easy, so I'm wondering why this hasn't been in any of the posts I've seen here regarding showing the decimals. Is there something wrong with this?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No, nothing wrong with it and it's out there in posts. DecimalToString() should have worked as well AFAIK, what syntax did you try?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post by Kryt0n »

DecimalToString is a parallel function isn't it?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Why, yes it is. Since the question was about contrasting the two approaches, I kind of ignored the Server job type / posted forum part. Perhaps that explains the "didn't get anywhere" comment. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
tracy
Participant
Posts: 47
Joined: Mon Aug 07, 2006 9:19 am

Post by tracy »

Thanks!

Since I got the "nothing wrong with it" response I was looking for, I'll follow your lead and ignore the rest of this so I don't waste anymore of your time. :wink:
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post by Kryt0n »

chulett wrote:Why, yes it is. Since the question was about contrasting the two approaches, I kind of ignored the Server job type / posted forum part. Perhaps that explains the "didn't get anywhere" comment. :wink:
I have a tendency to ignore that section too, just doesn't seem to stand out for me...
Post Reply