to_char(0,'FM999.99') outputs 0. - Mailing list pgsql-general

From sav@tut.by (Andrew)
Subject to_char(0,'FM999.99') outputs 0.
Date
Msg-id d2ddb96a.0208290023.f23170c@posting.google.com
Whole thread Raw
Responses Re: to_char(0,'FM999.99') outputs 0.  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-general
Hi All,
I know this question has already been here but still...

select to_char(1,'FM999.99')
1

select to_char(0,'FM999.99')
0.

and now I want to get rid of that trailing point !
if this bug hasn't been fixed yet, then what is the best workaround?
should I say something like this:

select case when n = 0 then '0' else to_char(n,'FM999.99') end

Good luck!
Andrew Surinov

pgsql-general by date:

Previous
From:
Date:
Subject: show ?
Next
From: Darren Ferguson
Date:
Subject: Re: Why must the function that a trigger calls return