Page 1 of 1

Stringtodecimal conversion error

Posted: Fri Sep 22, 2006 9:05 pm
by keshav0307
I have input of char( 8 ), how to convert it to decimal ( 8,8 ) in a transform stage.
it's working fine to convert decimal ( 8,0 ).

Posted: Fri Sep 22, 2006 10:00 pm
by kris007
What happens when you try to convert it to decimal[8,8]? Does it give any error?

Posted: Sat Sep 23, 2006 3:32 pm
by ray.wurlod
Precision must be at least one larger than scale. Decimal(8,8) is not an acceptable formulation; you need at least Decimal(9,8) to accommodate eight decimal places.

Posted: Sun Sep 24, 2006 5:45 am
by keshav0307
What happens when you try to convert it to decimal[8,8]? Does it give any error?
it convert any values to 0.00000000

Posted: Mon Sep 25, 2006 3:01 am
by keshav0307
Another thing i noticed is :
when the input is 00000000, StringToDecimal does not work.

Posted: Mon Sep 25, 2006 4:01 am
by pankajg
Ray, why does the precision needs to be larger than scale?? Any particular reason, and if the scale=percision what's the problem in there?

Posted: Mon Sep 25, 2006 2:57 pm
by ray.wurlod
It's just something I've noticed over the years. Decimal[N,N] should be able to represent numbers between zero and less than 1.0, theoretically, but it seems that some implementations need to be able to specify that there is a digit to the left of the decimal place holder.