(DECIMAL 17,2) 14.12345 --> 14.12

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
vinaymanchinila
Premium Member
Premium Member
Posts: 353
Joined: Wed Apr 06, 2005 8:45 am

(DECIMAL 17,2) 14.12345 --> 14.12

Post by vinaymanchinila »

Hi
I have an incomming decimal value (DECIMAL 17,2) say 14.12345 but I need just 2 places from the decimal like 14.12

I have tried to use the field function and extract the decimal portion of it so that I can append it to the value, but how do I extract the value before the delimter!

Thanks,
ogmios
Participant
Posts: 659
Joined: Tue Mar 11, 2003 3:40 pm

Re: (DECIMAL 17,2) 14.12345 --> 14.12

Post by ogmios »

As easier answer:
Ans = FMT(14.12345, 'R2')

Or

Ans = FMT(14.12345, 'T2')

First 1 rounds at 2, last one truncates at 2.

Ogmios
In theory there's no difference between theory and practice. In practice there is.
vinaymanchinila
Premium Member
Premium Member
Posts: 353
Joined: Wed Apr 06, 2005 8:45 am

Post by vinaymanchinila »

Thanks so much for helping me out on the weekend!
Post Reply