Re: decimal defaults
Posted in 1996
In article <4slnha$mj4@cssun.mathcs.emory.edu>, Jonathan Leffler <johnl@informix.com> writes >Assuming that you are running either DB-Access or ISQL, the basic answer >is that it is fixed in the display code and it is pretty much unchangable. >You can try setting DBFLTMASK to an integer number of digits after the >decimal point, but my experience is that it's flaky (assume 5.00 or earlier >experience -- it could have improved since then!), and you still run into >problems if you have extremely large or extremely small values in a column. > >Your best bet is to use the ESQL/C formatting functions -- I have code which >uses the obscure dececvt() and devfcvt() functions to format number in >scientific >or fixed point formats regardless of scale and precision, etc. > >Yours, >Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> > Something similar to This confused a college of mine the other day so I raised a support call. If you have a float variable and let a char variable = the float variable, the result is ROUNDED to 2 decimal places. This is on c4gl (6.02.UC1) on SE (7.11.UC1) on an ICL Teamserver. The tech support person said this was a feature on 4GL and was not likely to change. Can't see this documented in the manuals though? PS DBFLTMASK had no effect. The eventual solution was to use an intermediate decimal variable and a USING "####.######" clause. -- David Williams