rouding last digits to 2 decimal places

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Cherukuri
Participant
Posts: 46
Joined: Wed Jul 25, 2007 2:43 am
Location: India
Contact:

rouding last digits to 2 decimal places

Post by Cherukuri »

Hi,

Please give me a solutions for the below question:

my input data :

filed1
1.223
0.003
45.89
0.00006
45.8934

My output data :

field1 field2
12.23 10
0.03 10
45.89 1
0.06 1000
4589.34 100

so the out put data should be rounded to last 2 decimal places as an example shown above.
and also need the values that are multiplied to get the output values into the seperate field .
Cheru
arunkumarmm
Participant
Posts: 246
Joined: Mon Jun 30, 2008 3:22 am
Location: New York
Contact:

Post by arunkumarmm »

Try the below in your output column derivation. The value '10000000000' in the derivation depends on the maximum digits you get after the decimal point.

Column * (10000000000[1,(Len(Field(Column,'.',2))-1)]
Arun
Cherukuri
Participant
Posts: 46
Joined: Wed Jul 25, 2007 2:43 am
Location: India
Contact:

Post by Cherukuri »

hi Arun,

Thanks, for a quick solution it worked.
Cheru
Post Reply