Rainbow Deals - hours only!Up to 80% off on all courses and bundles.-Close
So you think you can count
Round and other functions
17. Round in Postgres – explanation
Revision and practice


In Postgres, to round a floating point number and specify a precision at the same time, you have to first cast it numeric. For example:

SELECT round(CAST(weight AS numeric),2)
FROM character;

will round the weight to two decimal places.


Round height to 2 decimal places.

Stuck? Here's a hint!

Here, you'll need round(CAST(height AS numeric),2).