-1
Opaa!
I made a select of a table that returns the value of a book with a percentage of adjustment, both negative and positive. But it is returning me a value with several decimal places, and I would like to limit to only 2 decimal places. Someone could help me?
Select command used, in this example I used 10%:
select
liv_titulo, liv_preco as preco_atual,
liv_preco + (liv_preco / 100 * 10) as preco_adicao,
liv_preco - (liv_preco / 100 * 10) as preco_subtracao
from livro 
The return of command was thus:
liv_titulo              preco_atual  preco_adicao  preco_subtracao
Engenharia de Software  55.00        60.500000     49.500000
Engenharia de software  78.01        85.811000     70.209000
I’d like to keep it that way:
liv_titulo              preco_atual  preco_adicao  preco_subtracao
Engenharia de Software  55.00        60.50         49.50
Engenharia de software  78.01        85.81         70.20
Here are several examples, depending on the version. https://stackoverflow.com/questions/10380197/sql-rounding-off-to-2-decimal-places
– Ernesto Casanova