Search Postgresql Archives

Re: Why length(to_char(1::integer, '9')) = 2 ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dmitriy Igrishin wrote:
> 2011/3/10 Bruce Momjian <bruce@xxxxxxxxxx>
> 
> > Dmitriy Igrishin wrote:
> > > dmitigr=> SELECT '>'||to_char(0.1, '0.99999')||'<' AS v;
> > >      v
> > > ------------
> > >  > 0.10000<
> > >
> > > dmitigr=> SELECT '>'||to_char(0.1, 'FM0.99999')||'<' AS v;
> > >    v
> > > -------
> > >  >0.1<
> > >
> > > So, padding zeroes suppressed by FM is a rest of the value.
> >
> > Any documentation changes suggested?
> >
> I propose to replace "fill mode (suppress padding blanks and zeroes)"
> located here
> http://www.postgresql.org/docs/9.0/static/functions-formatting.html#FUNCTIONS-FORMATTING-NUMERICMOD-TABLE
> with
> "fill mode (suppress padding blanks and trailing zeroes)".

Thanks.  Attached patch applied.

-- 
  Bruce Momjian  <bruce@xxxxxxxxxx>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index f746ed6..da45970 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -5446,7 +5446,7 @@ SELECT SUBSTRING('XY1234Z', 'Y*?([0-9]{1,3})');
       <tbody>
        <row>
         <entry><literal>FM</literal> prefix</entry>
-        <entry>fill mode (suppress padding blanks and zeroes)</entry>
+        <entry>fill mode (suppress padding blanks and trailing zeroes)</entry>
         <entry><literal>FMMonth</literal></entry>
        </row>
        <row>
@@ -5812,7 +5812,7 @@ SELECT SUBSTRING('XY1234Z', 'Y*?([0-9]{1,3})');
       <tbody>
        <row>
         <entry><literal>FM</literal> prefix</entry>
-        <entry>fill mode (suppress padding blanks and zeroes)</entry>
+        <entry>fill mode (suppress padding blanks and trailing zeroes)</entry>
         <entry><literal>FM9999</literal></entry>
        </row>
        <row>
-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux