for integer/bigint type while format to scientific notation, automatically get the correct number of precision - Mailing list pgsql-general

From jian he
Subject for integer/bigint type while format to scientific notation, automatically get the correct number of precision
Date
Msg-id CACJufxHcBYmC=7W=05gbEkxU7WAygSr4_U=2AH2YWOVBp23KpA@mail.gmail.com
Whole thread Raw
List pgsql-general
Hi,

looking for the reverse of select '1.2923904e+07'::numeric::int;
every time, I have to select to_char(12923904,'9.9999999EEEE');
if I do select to_char(12923904,'9.999999EEEE');
then the result is different.

For integer or bigint can I automatically have something like: 
select to_char(int,'9.(precision-1)EEEE');


--
 I recommend David Deutsch's <<The Beginning of Infinity>>

  Jian


pgsql-general by date:

Previous
From: Jan Bilek
Date:
Subject: Re: PCI:SSF - Safe SQL Query & operators filter
Next
From: Cedric Aaron Towstyka
Date:
Subject: Information to CVE-2022-42889