Page 1 of 1

string to decimal...

Posted: Fri Oct 22, 2010 1:32 pm
by allavivek
Hi all,,

My source is varchar(80) which is havin unsigned value .. ex: -13444.2333

My target is decimal(38,10)...

I gave

If IsNull( col) Then SetNull() Else StringToDecimal(UStringToString(TrimLeadingTrailing(col)))

iam getting all 0's instead of value....

I guess all the lenghts given are good...

Any suggestions....

Thanks...

Posted: Fri Oct 22, 2010 2:22 pm
by allavivek
Hi

if the input was -123.334 the length should be 8 but its showing me 9....

How to get rid of this??

Posted: Fri Oct 22, 2010 3:51 pm
by ray.wurlod
For starters, this can not be an unsigned value - it has a sign! Try changing the definition such that it is not recorded as unsigned.

Posted: Fri Oct 22, 2010 4:47 pm
by allavivek
ray.wurlod wrote:For starters, this can not be an unsigned value - it has a sign! Try changing the definition such that it is not recorded as unsigned. ...
ray iam having both signed and unsigned values as input...

Posted: Fri Oct 22, 2010 8:21 pm
by chulett
Therefor... signed.