Re: Converting a string to an Integer/decimal problem
Posted in 1998
In article <01bd86db$1116ab20$97812ac2@ioannisd>, Ioannis Demetriades <demetriades@dial.cylink.com.cy> wrote: >I am using informix 7.22 and I noticed that the following code will not >raise an exception > >define c integer; >let c = '1,,,2,,,3,,,4,5,6,7'; > >c gets the value 1234567 > > >Any ideas as to why informix ignores the commas within the string when it >converts a string to an integer? Because commas (or whatever the separator character is for your country, as communicated by the DBFORMAT or DBMONEY setting) are ignored as a convenience. Some users / source systems may enter a number with separator characters for readability, e.g. 1,234,567. Informix just ignores the separator character. (Try the same with other punctuation and you should get an error). -- Alan Denney yosemite_at_netcom.com "Virtuous motives, trammeled by inertia and timidity, are no match for armed and resolute wickedness." -- W. S. Churchill