Prefix a MINUS sign before a decimal number through trsfmr

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
saraswati
Premium Member
Premium Member
Posts: 149
Joined: Thu Feb 28, 2008 4:25 pm

Prefix a MINUS sign before a decimal number through trsfmr

Post by saraswati »

Suppose there is a value 46.126523000000 in the source.

I want to truncate the value to two decimal values.

I used a transformer derivation DecimalToDecimal(lnk.AmtPosted,"round_inf") to truncate the values into two decimal values.

I want to have a minus before the value.

Now the output value is 46.13 .

I want it to be -46.13 .

Please let me know how can I implement it ?
suse_dk
Participant
Posts: 93
Joined: Thu Aug 11, 2011 6:18 am
Location: Denmark

Post by suse_dk »

multiply with -1
_________________
- Susanne
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Multiply by -1 is definitely the easiest approach.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
saraswati
Premium Member
Premium Member
Posts: 149
Joined: Thu Feb 28, 2008 4:25 pm

Post by saraswati »

Does anyone else has got some other idea for getting the MINUS sign before the decimal number?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Of course, but none as elegant as multiplying by -1.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply