]> granicus.if.org Git - postgresql/commitdiff
to_char(float4/8): don't print "junk" digits
authorBruce Momjian <bruce@momjian.us>
Sun, 22 Mar 2015 01:50:03 +0000 (21:50 -0400)
committerBruce Momjian <bruce@momjian.us>
Sun, 22 Mar 2015 01:50:03 +0000 (21:50 -0400)
Commit cc0d90b73b2e6dd2f301d46818a7265742c41a14 also avoids printing
junk digits, which are digits that are beyond the precision of the
underlying type.

src/test/regress/expected/numeric.out
src/test/regress/sql/numeric.sql

index 46b0c72b6a340c9e97dddab7c19d943e7fb26427..a4d0161923fdbc44d27f74330aac3775e4220444 100644 (file)
@@ -1539,7 +1539,7 @@ SELECT to_char(float8 '1.123456789123456789', '9.' || repeat('9', 55));
 (1 row)
 
 SELECT to_char(float8 '1999999999999999999999999999999999999999999999.123456789123456789',
-        repeat('9', 50) || '.' || repeat('9', 50));
+       repeat('9', 50) || '.' || repeat('9', 50));
                                                 to_char                                                 
 --------------------------------------------------------------------------------------------------------
       1999999999999990000000000000000000000000000000.00000000000000000000000000000000000000000000000000
index a6301eab0a4096478e43768e16869e4b14aa3137..95c2203821a1a4a089c30716bffbf54e6ff07a99 100644 (file)
@@ -870,7 +870,7 @@ SELECT to_char(float8 '1e20','999999999999999999999D9');
 SELECT to_char(1e20, '999999999999999999999D9');
 SELECT to_char(float8 '1.123456789123456789', '9.' || repeat('9', 55));
 SELECT to_char(float8 '1999999999999999999999999999999999999999999999.123456789123456789',
-        repeat('9', 50) || '.' || repeat('9', 50));
+       repeat('9', 50) || '.' || repeat('9', 50));
 SELECT to_char(float8 '0.1', '9D' || repeat('9', 1000));
 SELECT to_char(int4 '1', '9D' || repeat('9', 1000) || 'EEEE');
 SELECT to_char(float4 '1', '9D' || repeat('9', 1000) || 'EEEE');