Re: 4GL: Decimal type manipulation
Posted in 1998
drance@my-dejanews.com wrote: > > Hi, > > My name is Duncan Rance and I'm working on an Informix-4GL application. > > I am trying to test a DECIMAL(3,1) to see if the digit after the decimal point > is zero, and if so, strip it (and then convert to an integer). I can't find > anything in the manuals to do this - a MOD command would help. > > If anyone can help, could you mail me as well as posting. > > Cheers, > Duncan > > -----== Posted via Deja News, The Leader in Internet Discussion ==----- > http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum Copy the decimal to an integer variable or a decimal with no places after the point, subtract the integer from the decimal and test for zero. Alternatively, try DEFINE temp CHAR(5) LET temp = mydecimal using "##&.&" IF (temp[5,5] = "0) THEN -- do your stuff END IF Why do you want to convert to an integer? Wouldn't a different printout of the same decimal value be enough? -- Peter Lancashire Information Systems Specialist, Bayer plc Eastern Way, Bury St Edmunds, Suffolk, IP32 7AH, UK Tel: +44-1635-562258, Fax: +44-1635-562281 --- If all else fails, read the instructions and the release notes. Join Infuse, the UK Informix User Group at http://www.infuse.org.uk/ ---