Skip to content

Commit 9d61b99

Browse files
committed
to_char(float4/8): don't print "junk" digits
Commit cc0d90b also avoids printing junk digits, which are digits that are beyond the precision of the underlying type.
1 parent cc0d90b commit 9d61b99

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/test/regress/expected/numeric.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1539,7 +1539,7 @@ SELECT to_char(float8 '1.123456789123456789', '9.' || repeat('9', 55));
15391539
(1 row)
15401540

15411541
SELECT to_char(float8 '1999999999999999999999999999999999999999999999.123456789123456789',
1542-
repeat('9', 50) || '.' || repeat('9', 50));
1542+
repeat('9', 50) || '.' || repeat('9', 50));
15431543
to_char
15441544
--------------------------------------------------------------------------------------------------------
15451545
1999999999999990000000000000000000000000000000.00000000000000000000000000000000000000000000000000

src/test/regress/sql/numeric.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ SELECT to_char(float8 '1e20','999999999999999999999D9');
870870
SELECT to_char(1e20, '999999999999999999999D9');
871871
SELECT to_char(float8 '1.123456789123456789', '9.' || repeat('9', 55));
872872
SELECT to_char(float8 '1999999999999999999999999999999999999999999999.123456789123456789',
873-
repeat('9', 50) || '.' || repeat('9', 50));
873+
repeat('9', 50) || '.' || repeat('9', 50));
874874
SELECT to_char(float8 '0.1', '9D' || repeat('9', 1000));
875875
SELECT to_char(int4 '1', '9D' || repeat('9', 1000) || 'EEEE');
876876
SELECT to_char(float4 '1', '9D' || repeat('9', 1000) || 'EEEE');

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy