How to limit the result of a query to 2 decimal places?

-1

I have the following query:

SELECT  SUM(ValorBruto)
FROM faturas
WHERE DataCaptura between'2018-10-01' and '2018-10-30'

The result is displayed to 4 decimal places. I would spend only viewing 2. How do I?

    
asked by anonymous 05.11.2018 / 17:25

1 answer

0

Try something like this

SELECT round(CAST(float8 SUM(ValorBruto) as valorBruto),2)
FROM faturas
WHERE DataCaptura between'2018-10-01' and '2018-10-30'
    
05.11.2018 / 17:44