Page 1 of 1

Decimal Range

Posted: Tue Dec 04, 2007 8:51 pm
by akhila.chitti
Hello,

I am trying to implement a logic within the transformer for an output column in a parallel job. This output column is producing the result like 3.24681234. I would like to see my result as 3.247. Do I use the DecimaltoDecimal function? If so, how would I write it? Is there any other way to achieve this desired result?

Thanks in advance,
Akhila.

Posted: Tue Dec 04, 2007 10:36 pm
by jhmckeever
Hi Akhila -

You don't need to use a function, just specify the appropriate precision and scale in the metadata of your output link. In your case you will want a scale of 3 for your output decimal column.

John.

Posted: Wed Jan 02, 2008 4:25 am
by akhila.chitti
Hello,

I understand that the change in the metadata range from 15,7 to 15,3 would work but then if I still need to get the output using some transformation logic or some function, then how would I be able to obtain the same?

Thanks in advance,
Akhila.

Posted: Wed Jan 02, 2008 4:58 am
by Mayur Dongaonkar
This can be achieved by using Substring function.

Posted: Wed Jan 02, 2008 11:01 am
by dspxlearn
Akhila-

Based on the example you provided, your value should get rounded at the 3rd place. So, as John said you don't need to use DecimalToDecimal function. Specify the required length and precision. It will automatically round the decimal value.
Akhila: I understand that the change in the metadata range from 15,7 to 15,3 would work but then if I still need to get the output using some transformation logic or some function, then how would I be able to obtain the same?
Why do need a detour if you have a straight and shortest way :?:
Is there any specific reason? - just curious :roll:
Mayur: This can be achieved by using Substring function.
Where is the 'Substring' function :?: :!: