{"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","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"],"signature":"round ( numeric ) → numeric","signature_count":3,"slug":"round","source_rev":"b7bd9cda","summary":"Rounds to nearest integer.","summary_zh":""}},"Definition":{"Collection":"func","Key":"round","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"round","SourceRevision":"b7bd9cda","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":"","description_zh_html":"","doc":{"anchor":"FUNCTIONS-MATH-FUNC-TABLE","file":"functions-math.html","slug":"18"},"group":"math","group_label":"Mathematical Functions And Operators","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":"","description_zh_html":"","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":""},{"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":"","description_zh_html":"","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":""},{"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":"","description_zh_html":"","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":""}],"zh_from":""},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-MATH-FUNC-TABLE","file":"functions-math.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"round","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"round","Summary":"舍入到最接近的整数。对于numeric，遇到恰好位于中点的情况时按远离零的方向舍入。对于double precision，中点取舍规则取决于平台，但“舍入到最接近的偶数”是最常见的规则。","BodyHTML":"舍入到最接近的整数。对于\u003ccode\u003enumeric\u003c/code\u003e，遇到恰好位于中点的情况时按远离零的方向舍入。对于\u003ccode\u003edouble precision\u003c/code\u003e，中点取舍规则取决于平台，但\u003cspan\u003e“\u003cspan\u003e舍入到最接近的偶数\u003c/span\u003e”\u003c/span\u003e是最常见的规则。\u003cpre\u003eround ( numeric ) → numeric\u003c/pre\u003e舍入到最接近的整数。对于\u003ccode\u003enumeric\u003c/code\u003e，遇到恰好位于中点的情况时按远离零的方向舍入。对于\u003ccode\u003edouble precision\u003c/code\u003e，中点取舍规则取决于平台，但\u003cspan\u003e“\u003cspan\u003e舍入到最接近的偶数\u003c/span\u003e”\u003c/span\u003e是最常见的规则。\u003cpre\u003eround ( double precision ) → double precision\u003c/pre\u003e舍入到最接近的整数。对于\u003ccode\u003enumeric\u003c/code\u003e，遇到恰好位于中点的情况时按远离零的方向舍入。对于\u003ccode\u003edouble precision\u003c/code\u003e，中点取舍规则取决于平台，但\u003cspan\u003e“\u003cspan\u003e舍入到最接近的偶数\u003c/span\u003e”\u003c/span\u003e是最常见的规则。\u003cpre\u003eround ( v numeric, s integer ) → numeric\u003c/pre\u003e将\u003cem\u003e\u003ccode\u003ev\u003c/code\u003e\u003c/em\u003e舍入到\u003cem\u003e\u003ccode\u003es\u003c/code\u003e\u003c/em\u003e位小数。遇到恰好位于中点的情况时按远离零的方向舍入。","SourceRevision":"ca936764","ContentHash":"3b0a6085d0112722f06173c75aa5e0463d1550a707b8a15f57e88ee2b69fbe76","Payload":{"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是最常见的规则。","signatures":[{"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是最常见的规则。","returns":"numeric","text":"round ( numeric ) → numeric","zh_from":"doc"},{"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是最常见的规则。","returns":"double precision","text":"round ( double precision ) → double precision","zh_from":"doc"},{"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位小数。遇到恰好位于中点的情况时按远离零的方向舍入。","returns":"numeric","text":"round ( v numeric, s integer ) → numeric","zh_from":"doc"}],"zh_from":"doc"}},"RequestedLocale":"zh-Hans","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":"","description_zh_html":"","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":""}},{"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":"","description_zh_html":"","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":""}},{"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":"","description_zh_html":"","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":""}}],"Spellings":null,"SQLState":null,"Evidence":null}
