| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> | 
|---|---|
| To: | Brendan Jurd <direvus(at)gmail(dot)com> | 
| Cc: | Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Euler Taveira de Oliveira <euler(at)timbira(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> | 
| Subject: | Re: WIP: to_char, support for EEEE format | 
| Date: | 2009-08-10 17:34:08 | 
| Message-ID: | 17042.1249925648@sss.pgh.pa.us | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
Brendan Jurd <direvus(at)gmail(dot)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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Alvaro Herrera | 2009-08-10 17:42:01 | Re: WIP: to_char, support for EEEE format | 
| Previous Message | Magnus Hagander | 2009-08-10 17:33:18 | Re: [PATCH] "could not reattach to shared memory" on Windows |