Page 1 of 1

Truncating the number

Posted: Wed Jun 07, 2006 3:15 am
by vinodhraj
Hi,

I want to truncate a number in transformer of datatype
Decimal(18,9) to Decimal(10,6).

Thanks

Vinod

Posted: Wed Jun 07, 2006 3:21 am
by ArndW
Truncating the decimal part is easy, either with a formatting option or a simple INT(In.Column*1000000)/1000000. But what is your rule for converting 18 digits to 10?

Re: Truncating the number

Posted: Wed Jun 07, 2006 3:34 am
by dprasanth
vinodhraj wrote:Hi,

I want to truncate a number in transformer of datatype
Decimal(18,9) to Decimal(10,6).

Thanks

Vinod
Try this conversion
Left((Field(var1,".",1)),10):".":Left((Field(var1,".",2)),6)

Posted: Wed Jun 07, 2006 3:35 pm
by ray.wurlod
To paraphrase Arnd's question: what happens if the number is too large for Decimal(10,6) ?