Re: Formatting query output

From: "Peter Gibbs" <peter(at)emkel(dot)co(dot)za>
To: "Pedro Miguel Frazao Fernandes Ferreira" <pfrazao(at)ualg(dot)pt>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Formatting query output
Date: 2002-10-29 10:37:44
Message-ID: 00be01c27f37$3752d760$0b01010a@emkel.co.za
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Pedro Miguel Frazao Fernandes Ferreira wrote:
> select real8 from test;
> real8
> ---------------------
> 4.5035996273705e+15

The conversion from float8 to text occurs in the float8out function,
defined in src/backend/utils/adt/float.c, using:
sprintf(ascii, "%.*g", DBL_DIG, num)
The value of DBL_DIG is defined in the standard include file <float.h>
and typically has a value of 15. I would not recommend changing this
value in <float.h>, but you could redefine it in float.c, or just change the
sprintf to use a hardcoded value of 16, and recompile and reinstall.
--
Peter Gibbs
EmKel Systems

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message ghinchliffe 2002-10-29 10:44:08 DAFS?
Previous Message Philip Rhoades 2002-10-29 10:28:57 Functions resembling stored procedures with Crystal Reports