Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 00037d8

Browse filesBrowse files
committed
Doc: document the tie-breaking behavior of the round() function.
Back-patch to v13; the table layout in older branches is unfriendly to adding such details. Laurenz Albe Discussion: https://postgr.es/m/161881920775.685.12293798764864559341@wrigleys.postgresql.org
1 parent a71cfc5 commit 00037d8
Copy full SHA for 00037d8

File tree

Expand file treeCollapse file tree

1 file changed

+5
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-2
lines changed

‎doc/src/sgml/func.sgml

Copy file name to clipboardExpand all lines: doc/src/sgml/func.sgml
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,7 +1617,10 @@ repeat('Pg', 4) <returnvalue>PgPgPgPg</returnvalue>
16171617
<returnvalue>double precision</returnvalue>
16181618
</para>
16191619
<para>
1620-
Rounds to nearest integer
1620+
Rounds to nearest integer. For <type>numeric</type>, ties are
1621+
broken by rounding away from zero. For <type>double precision</type>,
1622+
the tie-breaking behavior is platform dependent, but
1623+
<quote>round to nearest even</quote> is the most common rule.
16211624
</para>
16221625
<para>
16231626
<literal>round(42.4)</literal>
@@ -1632,7 +1635,7 @@ repeat('Pg', 4) <returnvalue>PgPgPgPg</returnvalue>
16321635
</para>
16331636
<para>
16341637
Rounds <parameter>v</parameter> to <parameter>s</parameter> decimal
1635-
places
1638+
places. Ties are broken by rounding away from zero.
16361639
</para>
16371640
<para>
16381641
<literal>round(42.4382, 2)</literal>

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.