{"Entry":{"collection":"func","key":"round","name":"round","aliases":[],"metadata":{"changed_in":["7.3","8.1"],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"7.2","group_changed":null,"signatures":{"added":["round ( dp or numeric ) → (same as input)"],"removed":["round ( dp ) → dp"]},"status":"changed","to":"7.3"},{"descriptions_changed":false,"doc_overhaul":false,"from":"8.0","group_changed":null,"signatures":{"added":["round ( v numeric, s int ) → numeric"],"removed":["round ( v numeric, s integer ) → numeric"]},"status":"changed","to":"8.1"},{"descriptions_changed":false,"doc_overhaul":true,"from":"12","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"13"}],"content_hash":"29f85a12b1c872cb582e9fbc7751afd48ad8a169cbee768081e9043252d08062","derived_content_hash":"3d9334f65453450abf4cb8b9c3bb27848c28383cc7764de3b18f87e36da987ba","documentation_refresh":{"batch":"20261113","original_source_rev":"wiki-repair-20261023:eb65ad21f81ddd3f9419e51ff13bbd6c2ac61b25bf5a0d8fd3f4917e23fe67fd","versions":{"14":"14.25","15":"15.20","16":"16.16","17":"17.12","18":"18.7","19":"19rc2"}},"first_version":"7.1","group":"math","group_label":"Mathematical Functions And Operators","groups":["math"],"imported_at":"2026-09-27T17:57:28.252664+08:00","last_version":"20","name":"round","name_key":"round","position":2042,"present_in":["7.1","7.2","7.3","7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"repair_provenance":{"original_source_revision":"wiki-repair-20261023:f37cf0394159ff0b5847cd9b868131321bd4933d5374bb6b85b1dc2a52cb9d16","receipt_sha256":"22b5615b4f7f480a3e4dd97fb954db97863039f952ffe0ee81acf52cf6c3d04a","repair":"wiki-repair-20261023"},"signature":"round ( numeric ) → numeric","signature_count":3,"slug":"round","source_rev":"wiki-repair-20261023:eb65ad21f81ddd3f9419e51ff13bbd6c2ac61b25bf5a0d8fd3f4917e23fe67fd","summary":"Rounds to nearest integer.","summary_zh":""}},"Definition":{"Collection":"func","Key":"round","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"round","SourceRevision":"wiki-repair-20261023:eb65ad21f81ddd3f9419e51ff13bbd6c2ac61b25bf5a0d8fd3f4917e23fe67fd","Facts":{"description":"Rounds to nearest integer. For numeric, ties are broken by rounding away from zero. For double precision, the tie-breaking behavior is platform dependent, but “round to nearest even” is the most common rule.","description_html":"Rounds to nearest integer. For \u003ccode class=\"type\"\u003enumeric\u003c/code\u003e, ties are broken by rounding away from zero. For \u003ccode class=\"type\"\u003edouble precision\u003c/code\u003e, the tie-breaking behavior is platform dependent, but \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003eround to nearest even\u003c/span\u003e”\u003c/span\u003e is the most common rule.","description_zh":"舍入到最接近的整数。对于 numeric，遇到恰好位于中点的情况时按远离零的方向舍入。对于 double precision，中点取舍规则取决于平台，但“舍入到最接近的偶数”是最常见的规则。","description_zh_html":"舍入到最接近的整数。对于 \u003ccode class=\"type\"\u003enumeric\u003c/code\u003e，遇到恰好位于中点的情况时按远离零的方向舍入。对于 \u003ccode class=\"type\"\u003edouble precision\u003c/code\u003e，中点取舍规则取决于平台，但\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003e舍入到最接近的偶数\u003c/span\u003e”\u003c/span\u003e是最常见的规则。","doc":{"anchor":"FUNCTIONS-MATH-FUNC-TABLE","file":"functions-math.html","sha256":"80bdcd3a2c7112aadf400e832cc7c8ee55e389d9b3c12e767c3fbb2b3364ef7b","slug":"18"},"documentation_revision":{"inputs":[{"file":"functions-math.html","kind":"same-version-reviewed-manual","locale":"en","sha256":"80bdcd3a2c7112aadf400e832cc7c8ee55e389d9b3c12e767c3fbb2b3364ef7b","version":"18.7"},{"file":"functions-math.html","kind":"same-version-reviewed-manual","locale":"zh-Hans","sha256":"b48c7e1d8abf0f030ad0ef2aa1403db7015a96af265d49a15eaa2f1945a13a5f","version":"18.7"}],"release":"18.7","runtime_remeasured":false,"source_revision":"pgdoc:b9f0e7232f60f380d642ac9b99226606c254b552"},"group":"math","group_label":"数学函数和操作符","lang":"en","layout":"table-new","pages":["functions-math.html"],"prose_only":false,"signatures":[{"description":"Rounds to nearest integer. For numeric, ties are broken by rounding away from zero. For double precision, the tie-breaking behavior is platform dependent, but “round to nearest even” is the most common rule.","description_html":"Rounds to nearest integer. For \u003ccode class=\"type\"\u003enumeric\u003c/code\u003e, ties are broken by rounding away from zero. For \u003ccode class=\"type\"\u003edouble precision\u003c/code\u003e, the tie-breaking behavior is platform dependent, but \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003eround to nearest even\u003c/span\u003e”\u003c/span\u003e is the most common rule.","description_zh":"舍入到最接近的整数。对于 numeric，遇到恰好位于中点的情况时按远离零的方向舍入。对于 double precision，中点取舍规则取决于平台，但“舍入到最接近的偶数”是最常见的规则。","description_zh_html":"舍入到最接近的整数。对于 \u003ccode class=\"type\"\u003enumeric\u003c/code\u003e，遇到恰好位于中点的情况时按远离零的方向舍入。对于 \u003ccode class=\"type\"\u003edouble precision\u003c/code\u003e，中点取舍规则取决于平台，但\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003e舍入到最接近的偶数\u003c/span\u003e”\u003c/span\u003e是最常见的规则。","examples":[{"expr":"round(42.4)","result":"42"}],"html":"\u003ccode class=\"function\"\u003eround\u003c/code\u003e ( \u003ccode class=\"type\"\u003enumeric\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003enumeric\u003c/code\u003e","returns":"numeric","text":"round ( numeric ) → numeric","zh_from":"same-version-manual"},{"description":"Rounds to nearest integer. For numeric, ties are broken by rounding away from zero. For double precision, the tie-breaking behavior is platform dependent, but “round to nearest even” is the most common rule.","description_html":"Rounds to nearest integer. For \u003ccode class=\"type\"\u003enumeric\u003c/code\u003e, ties are broken by rounding away from zero. For \u003ccode class=\"type\"\u003edouble precision\u003c/code\u003e, the tie-breaking behavior is platform dependent, but \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003eround to nearest even\u003c/span\u003e”\u003c/span\u003e is the most common rule.","description_zh":"舍入到最接近的整数。对于 numeric，遇到恰好位于中点的情况时按远离零的方向舍入。对于 double precision，中点取舍规则取决于平台，但“舍入到最接近的偶数”是最常见的规则。","description_zh_html":"舍入到最接近的整数。对于 \u003ccode class=\"type\"\u003enumeric\u003c/code\u003e，遇到恰好位于中点的情况时按远离零的方向舍入。对于 \u003ccode class=\"type\"\u003edouble precision\u003c/code\u003e，中点取舍规则取决于平台，但\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003e舍入到最接近的偶数\u003c/span\u003e”\u003c/span\u003e是最常见的规则。","examples":[{"expr":"round(42.4)","result":"42"}],"html":"\u003ccode class=\"function\"\u003eround\u003c/code\u003e ( \u003ccode class=\"type\"\u003edouble precision\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003edouble precision\u003c/code\u003e","returns":"double precision","text":"round ( double precision ) → double precision","zh_from":"same-version-manual"},{"description":"Rounds v to s decimal places. Ties are broken by rounding away from zero.","description_html":"Rounds \u003cem class=\"parameter\"\u003e\u003ccode\u003ev\u003c/code\u003e\u003c/em\u003e to \u003cem class=\"parameter\"\u003e\u003ccode\u003es\u003c/code\u003e\u003c/em\u003e decimal places. Ties are broken by rounding away from zero.","description_zh":"将 v 舍入到 s 位小数。遇到恰好位于中点的情况时按远离零的方向舍入。","description_zh_html":"将 \u003cem class=\"parameter\"\u003e\u003ccode\u003ev\u003c/code\u003e\u003c/em\u003e 舍入到 \u003cem class=\"parameter\"\u003e\u003ccode\u003es\u003c/code\u003e\u003c/em\u003e 位小数。遇到恰好位于中点的情况时按远离零的方向舍入。","examples":[{"expr":"round(42.4382, 2)","result":"42.44"},{"expr":"round(1234.56, -1)","result":"1230"}],"html":"\u003ccode class=\"function\"\u003eround\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003ev\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003enumeric\u003c/code\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003es\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003einteger\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003enumeric\u003c/code\u003e","returns":"numeric","text":"round ( v numeric, s integer ) → numeric","zh_from":"same-version-manual"}],"translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/functions-math.html","sha256":"b5f393c537ea29401867ea8b97292650ee67b0dd9e8cde535aae77bc594b3736"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"zh_from":"same-version-manual"},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-MATH-FUNC-TABLE","file":"functions-math.html","sha256":"80bdcd3a2c7112aadf400e832cc7c8ee55e389d9b3c12e767c3fbb2b3364ef7b","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"round","SourceDatabase":"center","Version":"18","Locale":"en","Title":"round","Summary":"Rounds to nearest integer. For numeric, ties are broken by rounding away from zero. For double precision, the tie-breaking behavior is platform dependent, but “round to nearest even” is the most common rule.","BodyHTML":"Rounds to nearest integer. For \u003ccode\u003enumeric\u003c/code\u003e, ties are broken by rounding away from zero. For \u003ccode\u003edouble precision\u003c/code\u003e, the tie-breaking behavior is platform dependent, but \u003cspan\u003e“\u003cspan\u003eround to nearest even\u003c/span\u003e”\u003c/span\u003e is the most common rule.","SourceRevision":"wiki-repair-20261023:eb65ad21f81ddd3f9419e51ff13bbd6c2ac61b25bf5a0d8fd3f4917e23fe67fd","ContentHash":"e53a41930129ffe72188a7e8a41e0091763e99488dd9acb5737bbe86a158b77b","Payload":{"description":"Rounds to nearest integer. For numeric, ties are broken by rounding away from zero. For double precision, the tie-breaking behavior is platform dependent, but “round to nearest even” is the most common rule.","description_html":"Rounds to nearest integer. For \u003ccode class=\"type\"\u003enumeric\u003c/code\u003e, ties are broken by rounding away from zero. For \u003ccode class=\"type\"\u003edouble precision\u003c/code\u003e, the tie-breaking behavior is platform dependent, but \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003eround to nearest even\u003c/span\u003e”\u003c/span\u003e is the most common rule.","signatures":[{"description":"Rounds to nearest integer. For numeric, ties are broken by rounding away from zero. For double precision, the tie-breaking behavior is platform dependent, but “round to nearest even” is the most common rule.","description_html":"Rounds to nearest integer. For \u003ccode class=\"type\"\u003enumeric\u003c/code\u003e, ties are broken by rounding away from zero. For \u003ccode class=\"type\"\u003edouble precision\u003c/code\u003e, the tie-breaking behavior is platform dependent, but \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003eround to nearest even\u003c/span\u003e”\u003c/span\u003e is the most common rule.","description_zh":"舍入到最接近的整数。对于 numeric，遇到恰好位于中点的情况时按远离零的方向舍入。对于 double precision，中点取舍规则取决于平台，但“舍入到最接近的偶数”是最常见的规则。","description_zh_html":"舍入到最接近的整数。对于 \u003ccode class=\"type\"\u003enumeric\u003c/code\u003e，遇到恰好位于中点的情况时按远离零的方向舍入。对于 \u003ccode class=\"type\"\u003edouble precision\u003c/code\u003e，中点取舍规则取决于平台，但\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003e舍入到最接近的偶数\u003c/span\u003e”\u003c/span\u003e是最常见的规则。","examples":[{"expr":"round(42.4)","result":"42"}],"html":"\u003ccode class=\"function\"\u003eround\u003c/code\u003e ( \u003ccode class=\"type\"\u003enumeric\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003enumeric\u003c/code\u003e","returns":"numeric","text":"round ( numeric ) → numeric","zh_from":"same-version-manual"},{"description":"Rounds to nearest integer. For numeric, ties are broken by rounding away from zero. For double precision, the tie-breaking behavior is platform dependent, but “round to nearest even” is the most common rule.","description_html":"Rounds to nearest integer. For \u003ccode class=\"type\"\u003enumeric\u003c/code\u003e, ties are broken by rounding away from zero. For \u003ccode class=\"type\"\u003edouble precision\u003c/code\u003e, the tie-breaking behavior is platform dependent, but \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003eround to nearest even\u003c/span\u003e”\u003c/span\u003e is the most common rule.","description_zh":"舍入到最接近的整数。对于 numeric，遇到恰好位于中点的情况时按远离零的方向舍入。对于 double precision，中点取舍规则取决于平台，但“舍入到最接近的偶数”是最常见的规则。","description_zh_html":"舍入到最接近的整数。对于 \u003ccode class=\"type\"\u003enumeric\u003c/code\u003e，遇到恰好位于中点的情况时按远离零的方向舍入。对于 \u003ccode class=\"type\"\u003edouble precision\u003c/code\u003e，中点取舍规则取决于平台，但\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003e舍入到最接近的偶数\u003c/span\u003e”\u003c/span\u003e是最常见的规则。","examples":[{"expr":"round(42.4)","result":"42"}],"html":"\u003ccode class=\"function\"\u003eround\u003c/code\u003e ( \u003ccode class=\"type\"\u003edouble precision\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003edouble precision\u003c/code\u003e","returns":"double precision","text":"round ( double precision ) → double precision","zh_from":"same-version-manual"},{"description":"Rounds v to s decimal places. Ties are broken by rounding away from zero.","description_html":"Rounds \u003cem class=\"parameter\"\u003e\u003ccode\u003ev\u003c/code\u003e\u003c/em\u003e to \u003cem class=\"parameter\"\u003e\u003ccode\u003es\u003c/code\u003e\u003c/em\u003e decimal places. Ties are broken by rounding away from zero.","description_zh":"将 v 舍入到 s 位小数。遇到恰好位于中点的情况时按远离零的方向舍入。","description_zh_html":"将 \u003cem class=\"parameter\"\u003e\u003ccode\u003ev\u003c/code\u003e\u003c/em\u003e 舍入到 \u003cem class=\"parameter\"\u003e\u003ccode\u003es\u003c/code\u003e\u003c/em\u003e 位小数。遇到恰好位于中点的情况时按远离零的方向舍入。","examples":[{"expr":"round(42.4382, 2)","result":"42.44"},{"expr":"round(1234.56, -1)","result":"1230"}],"html":"\u003ccode class=\"function\"\u003eround\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003ev\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003enumeric\u003c/code\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003es\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003einteger\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003enumeric\u003c/code\u003e","returns":"numeric","text":"round ( v numeric, s integer ) → numeric","zh_from":"same-version-manual"}]}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","7.1","7.2","7.3","7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":[{"Version":"18","Ordinal":0,"Hash":"13125e54af3e253d43e9802ca59acff30ee59ec98b0d1f29af775f9b44ec8505","Text":"round ( numeric ) → numeric","Returns":"numeric","Payload":{"description":"Rounds to nearest integer. For numeric, ties are broken by rounding away from zero. For double precision, the tie-breaking behavior is platform dependent, but “round to nearest even” is the most common rule.","description_html":"Rounds to nearest integer. For \u003ccode class=\"type\"\u003enumeric\u003c/code\u003e, ties are broken by rounding away from zero. For \u003ccode class=\"type\"\u003edouble precision\u003c/code\u003e, the tie-breaking behavior is platform dependent, but \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003eround to nearest even\u003c/span\u003e”\u003c/span\u003e is the most common rule.","description_zh":"舍入到最接近的整数。对于 numeric，遇到恰好位于中点的情况时按远离零的方向舍入。对于 double precision，中点取舍规则取决于平台，但“舍入到最接近的偶数”是最常见的规则。","description_zh_html":"舍入到最接近的整数。对于 \u003ccode class=\"type\"\u003enumeric\u003c/code\u003e，遇到恰好位于中点的情况时按远离零的方向舍入。对于 \u003ccode class=\"type\"\u003edouble precision\u003c/code\u003e，中点取舍规则取决于平台，但\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003e舍入到最接近的偶数\u003c/span\u003e”\u003c/span\u003e是最常见的规则。","examples":[{"expr":"round(42.4)","result":"42"}],"html":"\u003ccode class=\"function\"\u003eround\u003c/code\u003e ( \u003ccode class=\"type\"\u003enumeric\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003enumeric\u003c/code\u003e","returns":"numeric","text":"round ( numeric ) → numeric","zh_from":"same-version-manual"}},{"Version":"18","Ordinal":1,"Hash":"be8b85ad548736b75ed3863944e54aa2704fdf2ba1b0823be619d2fc1645f7b6","Text":"round ( double precision ) → double precision","Returns":"double precision","Payload":{"description":"Rounds to nearest integer. For numeric, ties are broken by rounding away from zero. For double precision, the tie-breaking behavior is platform dependent, but “round to nearest even” is the most common rule.","description_html":"Rounds to nearest integer. For \u003ccode class=\"type\"\u003enumeric\u003c/code\u003e, ties are broken by rounding away from zero. For \u003ccode class=\"type\"\u003edouble precision\u003c/code\u003e, the tie-breaking behavior is platform dependent, but \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003eround to nearest even\u003c/span\u003e”\u003c/span\u003e is the most common rule.","description_zh":"舍入到最接近的整数。对于 numeric，遇到恰好位于中点的情况时按远离零的方向舍入。对于 double precision，中点取舍规则取决于平台，但“舍入到最接近的偶数”是最常见的规则。","description_zh_html":"舍入到最接近的整数。对于 \u003ccode class=\"type\"\u003enumeric\u003c/code\u003e，遇到恰好位于中点的情况时按远离零的方向舍入。对于 \u003ccode class=\"type\"\u003edouble precision\u003c/code\u003e，中点取舍规则取决于平台，但\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003e舍入到最接近的偶数\u003c/span\u003e”\u003c/span\u003e是最常见的规则。","examples":[{"expr":"round(42.4)","result":"42"}],"html":"\u003ccode class=\"function\"\u003eround\u003c/code\u003e ( \u003ccode class=\"type\"\u003edouble precision\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003edouble precision\u003c/code\u003e","returns":"double precision","text":"round ( double precision ) → double precision","zh_from":"same-version-manual"}},{"Version":"18","Ordinal":2,"Hash":"de47948dea393e90484d251739f5111fd5d50a53a893b110983961c12e033348","Text":"round ( v numeric, s integer ) → numeric","Returns":"numeric","Payload":{"description":"Rounds v to s decimal places. Ties are broken by rounding away from zero.","description_html":"Rounds \u003cem class=\"parameter\"\u003e\u003ccode\u003ev\u003c/code\u003e\u003c/em\u003e to \u003cem class=\"parameter\"\u003e\u003ccode\u003es\u003c/code\u003e\u003c/em\u003e decimal places. Ties are broken by rounding away from zero.","description_zh":"将 v 舍入到 s 位小数。遇到恰好位于中点的情况时按远离零的方向舍入。","description_zh_html":"将 \u003cem class=\"parameter\"\u003e\u003ccode\u003ev\u003c/code\u003e\u003c/em\u003e 舍入到 \u003cem class=\"parameter\"\u003e\u003ccode\u003es\u003c/code\u003e\u003c/em\u003e 位小数。遇到恰好位于中点的情况时按远离零的方向舍入。","examples":[{"expr":"round(42.4382, 2)","result":"42.44"},{"expr":"round(1234.56, -1)","result":"1230"}],"html":"\u003ccode class=\"function\"\u003eround\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003ev\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003enumeric\u003c/code\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003es\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003einteger\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003enumeric\u003c/code\u003e","returns":"numeric","text":"round ( v numeric, s integer ) → numeric","zh_from":"same-version-manual"}}],"Spellings":null,"SQLState":null,"Evidence":null}
