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
-->
......@@ -4365,7 +4365,7 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
</row>
<row>
<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>
<entry><literal>to_char(-0.1, 'FM9.99')</literal></entry>
......@@ -4381,7 +4381,7 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
</row>
<row>
<entry><literal>to_char(12, 'FM9990999.9')</literal></entry>
<entry><literal>'0012'</literal></entry>
<entry><literal>'0012.'</literal></entry>
</row>
<row>
<entry><literal>to_char(485, '999')</literal></entry>
......@@ -4405,8 +4405,18 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
</row>
<row>
<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>
<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>
<entry><literal>to_char(148.5, '999D999')</literal></entry>
<entry><literal>'&nbsp;148,500'</literal></entry>
......@@ -4425,6 +4435,10 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
</row>
<row>
<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>
</row>
<row>
......
This diff is collapsed.
......@@ -139,7 +139,7 @@ SELECT '' AS to_char_3, to_char( (q1 * -1), '9999999999999999PR'), to_char( (q2
| <123> | <4567890123456789.000>
| <4567890123456789> | <123.000>
| <4567890123456789> | <4567890123456789.000>
| <4567890123456789> | 4567890123456789.000
| <4567890123456789> | 4567890123456789.000
(5 rows)
SELECT '' AS to_char_4, to_char( (q1 * -1), '9999999999999999S'), to_char( (q2 * -1), 'S9999999999999999')
......@@ -154,12 +154,12 @@ SELECT '' AS to_char_4, to_char( (q1 * -1), '9999999999999999S'), to_char( (q2 *
(5 rows)
SELECT '' AS to_char_5, to_char(q2, 'MI9999999999999999') FROM INT8_TBL;
to_char_5 | to_char
-----------+--------------------
| 456
| 4567890123456789
| 123
| 4567890123456789
to_char_5 | to_char
-----------+-------------------
| 456
| 4567890123456789
| 123
| 4567890123456789
| -4567890123456789
(5 rows)
......@@ -256,11 +256,11 @@ SELECT '' AS to_char_14, to_char(q2, 'FM9999999999999999.999') FROM INT8_TBL;
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') FROM INT8_TBL;
to_char_15 | to_char
------------+-------------------------------------------
| +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
| +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 . 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
| +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)
SELECT '' AS to_char_16, to_char(q2, '99999 "text" 9999 "9999" 999 "\\"text between quote marks\\"" 9999') FROM INT8_TBL;
......
......@@ -732,15 +732,15 @@ SELECT '' AS to_char_3, to_char(val, '9999999999999999.999999999999999PR')
FROM num_data;
to_char_3 | to_char
-----------+------------------------------------
| .000000000000000
| .000000000000000
| .000000000000000
| .000000000000000
| <34338492.215397047000000>
| 4.310000000000000
| 7799461.411900000000000
| 16397.038491000000000
| 93901.577630260000000
| 4.310000000000000
| 7799461.411900000000000
| 16397.038491000000000
| 93901.577630260000000
| <83028485.000000000000000>
| 74881.000000000000000
| 74881.000000000000000
| <24926804.045047420000000>
(10 rows)
......@@ -761,17 +761,17 @@ SELECT '' AS to_char_4, to_char(val, '9999999999999999.999999999999999S')
(10 rows)
SELECT '' AS to_char_5, to_char(val, 'MI9999999999999999.999999999999999') FROM num_data;
to_char_5 | to_char
-----------+------------------------------------
| .000000000000000
| .000000000000000
to_char_5 | to_char
-----------+-----------------------------------
| .000000000000000
| .000000000000000
| - 34338492.215397047000000
| 4.310000000000000
| 7799461.411900000000000
| 16397.038491000000000
| 93901.577630260000000
| 4.310000000000000
| 7799461.411900000000000
| 16397.038491000000000
| 93901.577630260000000
| - 83028485.000000000000000
| 74881.000000000000000
| 74881.000000000000000
| - 24926804.045047420000000
(10 rows)
......@@ -958,31 +958,31 @@ 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;
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
| -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
| +7 7 9 9 4 6 1 . 4 1 1 9 0 0 0 0 0 0 0 0 0 0 0 0 0
| +1 6 3 9 7 . 0 3 8 4 9 1 0 0 0 0 0 0 0 0 0 0 0
| +9 3 9 0 1 . 5 7 7 6 3 0 2 6 0 0 0 0 0 0 0 0 0
| -8 3 0 2 8 4 8 5 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
| +7 4 8 8 1 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
| -2 4 9 2 6 8 0 4 . 0 4 5 0 4 7 4 2 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
| +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
| +1 6 3 9 7 . 0 3 8 4 9 1 0 0 0 0 0 0 0 0 0 0 0
| +9 3 9 0 1 . 5 7 7 6 3 0 2 6 0 0 0 0 0 0 0 0 0
| -8 3 0 2 8 4 8 5 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
| +7 4 8 8 1 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
| -2 4 9 2 6 8 0 4 . 0 4 5 0 4 7 4 2 0 0 0 0 0 0 0 0 0
(10 rows)
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
------------+-------------------------------------------------------
| + 0 .
| + 0 .
| - 3 4 3 3 8 4 9 2 . 2 1 5 3 9 7 0 4 7
| + 4 . 3 1
| + 7 7 9 9 4 6 1 . 4 1 1 9
| + 1 6 3 9 7 . 0 3 8 4 9 1
| + 9 3 9 0 1 . 5 7 7 6 3 0 2 6
| - 8 3 0 2 8 4 8 5 .
| + 7 4 8 8 1 .
| - 2 4 9 2 6 8 0 4 . 0 4 5 0 4 7 4 2
| +0 .
| +0 .
| -3 4 3 3 8 4 9 2 . 2 1 5 3 9 7 0 4 7
| +4 . 3 1
| +7 7 9 9 4 6 1 . 4 1 1 9
| +1 6 3 9 7 . 0 3 8 4 9 1
| +9 3 9 0 1 . 5 7 7 6 3 0 2 6
| -8 3 0 2 8 4 8 5 .
| +7 4 8 8 1 .
| -2 4 9 2 6 8 0 4 . 0 4 5 0 4 7 4 2
(10 rows)
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