Page 1 of 1

char to integer32

Posted: Sun Jul 24, 2005 9:40 am
by ds_is_fun
Char to numeric conversion. Any suggestions?

Posted: Sun Jul 24, 2005 10:15 am
by kumar_s
I could not understand your need clearly.....
it seems you need to conver char (source) to int (target) am i right.
int32 is againg the integer right.But it is just a long one.
so if the source is 0000 then it suppose to be reflected as 0 in the target right.

regards
deepak

Posted: Sun Jul 24, 2005 5:20 pm
by ds_is_fun
What could be done to avoid this transformation?
thanks

Posted: Sun Jul 24, 2005 7:54 pm
by chulett
Umm... nothing. :? There's nothing wrong with what's happening. Any number of character zeroes sent to an integer field will become a numeric zero.

About the only way to 'avoid this transformation' would be to redefine your target field to be character as well.

Re: char to integer32

Posted: Sun Jul 24, 2005 10:00 pm
by ray.wurlod
ds_is_fun wrote:Char to numeric conversion. Any suggestions?
int32_from_string in Modify stage. Just be very sure that every value can accurately be converted.

Re: char to integer32

Posted: Wed Jul 27, 2005 12:10 am
by goosarikiran
ds_is_fun wrote:Char to numeric conversion. Any suggestions?
char is left justified and int is right justified.

Posted: Wed Jul 27, 2005 1:23 am
by ray.wurlod
So?

Trim trailing white space if that's necessary.

"12345" can be converted to an integer whether it's left- or right-justified.
Trim("12345 ") can also be happily converted to an integer.