Commit 7a3e7b64 authored by Bruce Momjian's avatar Bruce Momjian

to_char fixes, Karel Zak

parent bf576cc0
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.148 2003/03/25 16:15:36 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.149 2003/03/27 16:35:30 momjian Exp $
PostgreSQL documentation PostgreSQL documentation
--> -->
...@@ -4365,7 +4365,7 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation> ...@@ -4365,7 +4365,7 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
</row> </row>
<row> <row>
<entry><literal>to_char(-0.1, '99.99')</literal></entry> <entry><literal>to_char(-0.1, '99.99')</literal></entry>
<entry><literal>'&nbsp;-.10'</literal></entry> <entry><literal>'&nbsp;&nbsp;-.10'</literal></entry>
</row> </row>
<row> <row>
<entry><literal>to_char(-0.1, 'FM9.99')</literal></entry> <entry><literal>to_char(-0.1, 'FM9.99')</literal></entry>
...@@ -4381,7 +4381,7 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation> ...@@ -4381,7 +4381,7 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
</row> </row>
<row> <row>
<entry><literal>to_char(12, 'FM9990999.9')</literal></entry> <entry><literal>to_char(12, 'FM9990999.9')</literal></entry>
<entry><literal>'0012'</literal></entry> <entry><literal>'0012.'</literal></entry>
</row> </row>
<row> <row>
<entry><literal>to_char(485, '999')</literal></entry> <entry><literal>to_char(485, '999')</literal></entry>
...@@ -4405,8 +4405,18 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation> ...@@ -4405,8 +4405,18 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
</row> </row>
<row> <row>
<entry><literal>to_char(148.5, '999.999')</literal></entry> <entry><literal>to_char(148.5, '999.999')</literal></entry>
<entry><literal>' 148.500'</literal></entry> <entry><literal>'&nbsp;148.500'</literal></entry>
</row> </row>
<row>
<entry><literal>to_char(148.5, 'FM999.999')</literal></entry>
<entry><literal>'148.5'</literal></entry>
</row>
<row>
<row>
<entry><literal>to_char(148.5, 'FM999.990')</literal></entry>
<entry><literal>'148.500'</literal></entry>
</row>
<row>
<row> <row>
<entry><literal>to_char(148.5, '999D999')</literal></entry> <entry><literal>to_char(148.5, '999D999')</literal></entry>
<entry><literal>'&nbsp;148,500'</literal></entry> <entry><literal>'&nbsp;148,500'</literal></entry>
...@@ -4425,6 +4435,10 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation> ...@@ -4425,6 +4435,10 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
</row> </row>
<row> <row>
<entry><literal>to_char(485, '999MI')</literal></entry> <entry><literal>to_char(485, '999MI')</literal></entry>
<entry><literal>'485&nbsp;'</literal></entry>
</row>
<row>
<entry><literal>to_char(485, 'FM999MI')</literal></entry>
<entry><literal>'485'</literal></entry> <entry><literal>'485'</literal></entry>
</row> </row>
<row> <row>
......
This diff is collapsed.
...@@ -155,7 +155,7 @@ SELECT '' AS to_char_4, to_char( (q1 * -1), '9999999999999999S'), to_char( (q2 * ...@@ -155,7 +155,7 @@ SELECT '' AS to_char_4, to_char( (q1 * -1), '9999999999999999S'), to_char( (q2 *
SELECT '' AS to_char_5, to_char(q2, 'MI9999999999999999') FROM INT8_TBL; SELECT '' AS to_char_5, to_char(q2, 'MI9999999999999999') FROM INT8_TBL;
to_char_5 | to_char to_char_5 | to_char
-----------+-------------------- -----------+-------------------
| 456 | 456
| 4567890123456789 | 4567890123456789
| 123 | 123
...@@ -257,10 +257,10 @@ SELECT '' AS to_char_15, to_char(q2, 'S 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9' ...@@ -257,10 +257,10 @@ SELECT '' AS to_char_15, to_char(q2, 'S 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9'
to_char_15 | to_char to_char_15 | to_char
------------+------------------------------------------- ------------+-------------------------------------------
| +4 5 6 . 0 0 0 | +4 5 6 . 0 0 0
| + 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 . 0 0 0 | +4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 . 0 0 0
| +1 2 3 . 0 0 0 | +1 2 3 . 0 0 0
| + 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 . 0 0 0 | +4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 . 0 0 0
| - 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 . 0 0 0 | -4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 . 0 0 0
(5 rows) (5 rows)
SELECT '' AS to_char_16, to_char(q2, '99999 "text" 9999 "9999" 999 "\\"text between quote marks\\"" 9999') FROM INT8_TBL; SELECT '' AS to_char_16, to_char(q2, '99999 "text" 9999 "9999" 999 "\\"text between quote marks\\"" 9999') FROM INT8_TBL;
......
...@@ -762,7 +762,7 @@ SELECT '' AS to_char_4, to_char(val, '9999999999999999.999999999999999S') ...@@ -762,7 +762,7 @@ SELECT '' AS to_char_4, to_char(val, '9999999999999999.999999999999999S')
SELECT '' AS to_char_5, to_char(val, 'MI9999999999999999.999999999999999') FROM num_data; SELECT '' AS to_char_5, to_char(val, 'MI9999999999999999.999999999999999') FROM num_data;
to_char_5 | to_char to_char_5 | to_char
-----------+------------------------------------ -----------+-----------------------------------
| .000000000000000 | .000000000000000
| .000000000000000 | .000000000000000
| - 34338492.215397047000000 | - 34338492.215397047000000
...@@ -958,8 +958,8 @@ SELECT '' AS to_char_17, to_char(val, 'FM9999999999999999.99999999999999') FROM ...@@ -958,8 +958,8 @@ SELECT '' AS to_char_17, to_char(val, 'FM9999999999999999.99999999999999') FROM
SELECT '' AS to_char_18, to_char(val, 'S 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9') FROM num_data; SELECT '' AS to_char_18, to_char(val, 'S 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9') FROM num_data;
to_char_18 | to_char to_char_18 | to_char
------------+----------------------------------------------------------------------- ------------+-----------------------------------------------------------------------
| . +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | +. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
| . +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | +. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
| -3 4 3 3 8 4 9 2 . 2 1 5 3 9 7 0 4 7 0 0 0 0 0 0 0 0 | -3 4 3 3 8 4 9 2 . 2 1 5 3 9 7 0 4 7 0 0 0 0 0 0 0 0
| +4 . 3 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | +4 . 3 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
| +7 7 9 9 4 6 1 . 4 1 1 9 0 0 0 0 0 0 0 0 0 0 0 0 0 | +7 7 9 9 4 6 1 . 4 1 1 9 0 0 0 0 0 0 0 0 0 0 0 0 0
...@@ -973,16 +973,16 @@ SELECT '' AS to_char_18, to_char(val, 'S 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9 ...@@ -973,16 +973,16 @@ SELECT '' AS to_char_18, to_char(val, 'S 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9
SELECT '' AS to_char_19, to_char(val, 'FMS 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9') FROM num_data; SELECT '' AS to_char_19, to_char(val, 'FMS 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9') FROM num_data;
to_char_19 | to_char to_char_19 | to_char
------------+------------------------------------------------------- ------------+-------------------------------------------------------
| + 0 . | +0 .
| + 0 . | +0 .
| - 3 4 3 3 8 4 9 2 . 2 1 5 3 9 7 0 4 7 | -3 4 3 3 8 4 9 2 . 2 1 5 3 9 7 0 4 7
| + 4 . 3 1 | +4 . 3 1
| + 7 7 9 9 4 6 1 . 4 1 1 9 | +7 7 9 9 4 6 1 . 4 1 1 9
| + 1 6 3 9 7 . 0 3 8 4 9 1 | +1 6 3 9 7 . 0 3 8 4 9 1
| + 9 3 9 0 1 . 5 7 7 6 3 0 2 6 | +9 3 9 0 1 . 5 7 7 6 3 0 2 6
| - 8 3 0 2 8 4 8 5 . | -8 3 0 2 8 4 8 5 .
| + 7 4 8 8 1 . | +7 4 8 8 1 .
| - 2 4 9 2 6 8 0 4 . 0 4 5 0 4 7 4 2 | -2 4 9 2 6 8 0 4 . 0 4 5 0 4 7 4 2
(10 rows) (10 rows)
SELECT '' AS to_char_20, to_char(val, '99999 "text" 9999 "9999" 999 "\\"text between quote marks\\"" 9999') FROM num_data; SELECT '' AS to_char_20, to_char(val, '99999 "text" 9999 "9999" 999 "\\"text between quote marks\\"" 9999') FROM num_data;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment