Page 1 of 1

DecimalToString warning in job

Posted: Thu Jun 28, 2007 3:36 am
by kd813
While using the following command :
DecimalToString(lReadInput.NRx1,"fix_zero,suppress_zero")

I m getting the following warning:
"Transformer_0,0: Conversion error converting input field NRx1 to output field NRx1, data may have been lost"

My input datatype is decimal(9,3) and output datatype is varchar(9)

Posted: Thu Jun 28, 2007 3:42 am
by balajisr
Try giving output datatype to varchar(11)

Posted: Thu Jun 28, 2007 4:22 am
by ray.wurlod
:idea: It would be a better learning experience were you to explain why.

Posted: Thu Jun 28, 2007 5:31 am
by balajisr
ray.wurlod wrote::idea: It would be a better learning experience were you to explain why.
Sure.

9 + 1(Sign) + 1(Decimal Point)= Varchar(11)

Posted: Thu Jun 28, 2007 7:12 am
by ray.wurlod
Well done.

In words, the string needs nine characters for the nine significant digits (precision of the Decimal data type), plus one for the sign and one for the decimal point character. That's a total of eleven characters. The VarChar needs to be at least this large.

Posted: Thu Jun 28, 2007 7:27 am
by DSguru2B
A golden star awaits :wink: