I can see no reason that there is a period after 0 but not after 1.
Sure looks like a bug to me. Added to TODO:
* to_char(0,'FM999.99') returns a period, to_char(1,'FM999.99') does not
---------------------------------------------------------------------------
Andrew wrote:
> 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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073