Re: ISQL rounding
Posted in 1995
In article: <3nkgnc$qls$1@perth.DIALix.oz.au> rswa@perth.DIALix.oz.au (Radio Spares) writes: > Xref: news.demon.co.uk comp.databases.informix:10501 > Path: lintel.demon.co.uk!news.demon.co.uk!peernews.demon.co.uk!doc.news.pipex.net! pipex!swrinde!howland.reston.ans.net!news.cac.psu.edu!news.pop.psu.edu!hudso n.lm.com!newsfeed.pitt.edu!uunet!DIALix!not-for-mail > From: rswa@perth.DIALix.oz.au (Radio Spares) > Newsgroups: comp.databases.informix > Subject: ISQL rounding > Date: 26 Apr 1995 12:03:56 +0800 > Organization: DIALix Services, Perth, Australia. > Lines: 27 > Sender: rswa@perth.DIALix.oz.au > Message-ID: <3nkgnc$qls$1@perth.DIALix.oz.au> > NNTP-Posting-Host: perth.dialix.oz.au > NNTP-Posting-User: rswa > > > Can anyone help me with the below question? > > O/S: SunOS 5.3 > ISQL: 4.11.UC1 > ONLINE: 5.01.UD3 > > How come ISQL does arbitrary rounding in select statements? > > For example filed1 is decimal(16,4), field2 is int. > > select field1/field2 returns a rounded value to 2 decimal places. > > Even if you multiply the result by 1.0000 it still remains rounded up to > 2 decimal places. > > BTW, the rounded up value is 0.03 but if you try select field1/field2*10000 > you get 2630. But if you try select field1/field2*10000/10000 you get 0.03 > again. Also select field1*1.00 produces integer format for the output but > field1*"1.00" produces output to 2 decimal places. But field1*"1.000" still > only produces output to 2 decimal places. > > Does anyone have any idea why this is or how to get around it? > > > Jason Harris (RSWA) > > > Its not "rounded" to two decimal places - only displayed.... -- Mike Aubury Senior Technical Consultant