↑↓ select ↵ open ⌫ change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Functions / Mathematical Functions And Operators

Rounds to nearest integer.

Reading PG 18current·documented in 27 of 27 versions, 7.1 to 20

Signatures & examples

round ( numeric ) → numeric
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.
round(42.4) → 42
round ( double precision ) → double precision
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.
round(42.4) → 42
round ( v numeric, s integer ) → numeric
Rounds v to s decimal places. Ties are broken by rounding away from zero.
round(42.4382, 2) → 42.44
round(1234.56, -1) → 1230
Version history 3
  1. 12 → 13 changed
  2. 8.0 → 8.1 changed
  3. 7.2 → 7.3 changed

Definition snapshot: b7bd9cda · English manual source