Re: to_char(0,'9999.99') -> ".00"

From: Phil Endecott <spam_from_postgresql_general(at)chezphil(dot)org>
To: pgsql-general(at)postgresql(dot)org
Cc: Dave Smith <dave(dot)smith(at)candata(dot)com>
Subject: Re: to_char(0,'9999.99') -> ".00"
Date: 2005-01-11 13:18:20
Message-ID: 41E3D21C.5030201@chezphil.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I asked:
>> to_char(0,'9999.99')
>>
>>returns .00 rather than 0.00.

Dave Smith replied:
> to_char(0,'9990.00')
> ?

Thanks Dave, that's embarrassingly obvious...

I note that the examples in the documentation don't have a 0 before the
decimal point, e.g. this one

to_char(148.5, 'FM999.990') '148.500'

I imagine that in most cases people do want '0.000' rather than '.000',
so perhaps these examples should be changed to, in this case, 990.000.

Regards,

--Phil.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2005-01-11 13:26:06 Re: views in 8.0
Previous Message SZŰCS Gábor 2005-01-11 13:13:38 StartTransact back at Debug2 in v8?