Re: WIP: to_char, support for EEEE format - Mailing list pgsql-hackers

From Tom Lane
Subject Re: WIP: to_char, support for EEEE format
Date
Msg-id 17042.1249925648@sss.pgh.pa.us
Whole thread Raw
In response to Re: WIP: to_char, support for EEEE format  (Brendan Jurd <direvus@gmail.com>)
Responses Re: WIP: to_char, support for EEEE format  (Alvaro Herrera <alvherre@commandprompt.com>)
Re: WIP: to_char, support for EEEE format  (Brendan Jurd <direvus@gmail.com>)
List pgsql-hackers
Brendan Jurd <direvus@gmail.com> writes:
> Thanks Tom.  I have removed the V1 stuff as you suggest, and placed
> the declaration in numeric.h.

> Here's version 7.

Working through this now, and I noticed that the example added to the
manual seems to be wrong:
       <entry><literal>to_char(0.000485, '9.99EEEE')</literal></entry>       <entry><literal>'
4.850e-04'</literal></entry>

With 9.99 as the pattern, I'd expect (and indeed I get) 4.85e-04
not 4.850e-04.  This is correct behavior, no?

Also, I'm wondering what should happen with

regression=# select to_char(0.000485, '99.99EEEE'); to_char  
----------- 4.85e-04
(1 row)

Doesn't seem quite right.  Should we throw error if the number of 9's
before the decimal point isn't 1?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: [PATCH] "could not reattach to shared memory" on Windows
Next
From: Alvaro Herrera
Date:
Subject: Re: WIP: to_char, support for EEEE format