Re: Truncating Result for reporting
Posted in 1997
INDECO ENGINEERS PTE LTD - VEHICLES & EQUIPMENT DIVISION wrote:
>
> To : All informix experts
->A-hem!<-
>
> Can someone teach me how to truncate a mathematics calculation for
> reporting purposes?
>
I assume you're using 4GL or NewEra, and by truncate you don't mean to
round off a value to the lowest whole number, but instead you want to
display a numeric value without all the leading spaces.
See the USING clause. For instance to display a whole number guaranteed
to be four digits or less as a left-justified number:
PRINT x USING "<<<<"
If you're trying to do the same thing via SQL (dbaccess or ISQL), you'll
have more trouble. I think selecting into a temp table that stores the
calculation as a CHAR with the appropriate length, then fetching out of
that table for display, might work, but I haven't tried it.
> Is such feature available in Informix.
>
> Kindly advise.
> Katherine
> email : ieplved@singnet.com.sg
>
> Thanks Thanks ......
--
//////////////// =======================================================
////////// // Dennis J. Pimple Informix Software, Inc.
////// / /// Principal Consultant 6300 S Syracuse Way Ste 205
///// // //// dennisp@informix.com Englewood CO 80111
//// // /////
/// // ////// recept: 303-850-0210
// // /////// direct: 303-740-5611 Opinions expressed are mine,
/ /////////// fax: 303-779-4025 and do not necessarily
//////////////// http://www.informix.com reflect those of my employer