Re: to_char(0,'9999.99') -> ".00" - Mailing list pgsql-general

From Phil Endecott
Subject Re: to_char(0,'9999.99') -> ".00"
Date
Msg-id 41E3D21C.5030201@chezphil.org
Whole thread Raw
In response to Re: to_char(0,'9999.99') -> ".00"  (Dave Smith <dave.smith@candata.com>)
List 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.


pgsql-general by date:

Previous
From: "Jason Tesser"
Date:
Subject: views in 8.0
Next
From: Peter Eisentraut
Date:
Subject: Re: views in 8.0