Re: Display only 2 frac_digits in decimal(12).
Posted in 2003
Hi June.
Thanks for your reply.
I can display 4 digits.
i.e) 1234.5678 !
It works fine.
Regards.
--
Tsutomu Ogiwara from Tokyo Japan.
ICQ#:168106592
>From: "June C. Hunt" <june_c_hunt@hotmail.com>
>Reply-To: "June C. Hunt" <june_c_hunt@hotmail.com>
>To: informix-list@iiug.org
>Subject: Re: Display only 2 frac_digits in decimal(12).
>Date: Fri, 05 Dec 2003 10:49:05 GMT
>
>Tsutomu Ogiwara wrote:
> > My customer using ISQL 4.3.
> > Now Customer will upgrade 4.3 to 7.32.
> >
> > Customer has a problem using ISQL 7.32.UC1 as bellow.
> >
> > create table test1(
> > a decimal(12),
> > b decimal(12.7)
> > );> > a.per
> > database stores_demo
> > screen size 24 by 80
> > {
> > a [f000 ]
> > b [f001 ]
> > }
> > end
> > tables
> > test1
> > attributes
> > f000 = test1.a;
> > f001 = test1.b;
> >
> > Compile a.per.
> >
> > Insert field a as 1234.5678.
> > DISPLAY fileld a as 1234.57.
> >
> > Only 2 frac digits.
> >
> > I searched comp.databases.informix, I found DBFLTMASK.
> > However I setted DBFLTMASK=4, no effect.
> > Still appears 2 digit(1234.57).
> >
> > How can I do display 4 digits instead of 2 digits.
> >
> > ENV:
> > Redhat 7.3
> > IDS 9.30.UC3
> > ISQL 7.32.UC1
>
>Since field a is defined simply as a decimal(12) without the scale
>parameter, I believe the data is being treated as a floating decimal - and
>it is rounding the displayed value. If my memory on this is correct, a
>DECIMAL defined without a scale parameter will print with two decimal
>places
>unless you specify another format. Can you add a FORMAT attribute to field
>a in the screen form to force the display?
>
>For example:
>f000=test1.a, format="####.####";
>
>Again, if I remember this correctly, you'll get a warning if the format
>string is shorter than the field width, but it is just a warning. Of
>course, one possible problem with this suggestion is that you'll always get
>four decimal places, regardless of the number that was entered.
>
>--
>June Hunt
>
>
_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
sending to informix-list