title: How to ROUND double precision type values?
body: <p>I use pgAdmin 4.. and I am trying to figure out, how to round column rental_period, which was extracted from deducting 2 timestamp columns and now consists out of double precision data type. I want to round it on 2 decimal places. Here is the script that returns error:</p>
  
  <pre><code>SELECT customer_id, ROUND (AVG (extract (day from (return_date - rental_date))), 2) AS rental_period
  FROM rental
  GROUP BY customer_id;
  </code></pre>
  
  <p>The error says:</p>
  
  <blockquote>
    <p>ERROR:  syntax error at or near "AS"</p>
    
    <p>LINE 1: ...xtract (day from (return_date - rental_date)), 2) AS
    rental_...
                                                                 ^ SQL state: 42601</p>
    
    <p>Character: 84</p>
  </blockquote>
  
  <p>And here is a script which works fine, but returns too many decimal places:</p>
  
  <pre><code>SELECT customer_id, AVG (extract (day from (return_date - rental_date))) AS rental_period
  FROM rental
  GROUP BY customer_id;
  </code></pre>
  
  <p>Thank you)</p>