I would like to know how exactly the sql server round works.
Others questions says:
PRINT ROUND(1890.125000, 2)
produces 1890.130000
PRINT ROUND(1890.124999, 2)
produces 1890.12000
all clear,
But,
I have a table in sql that represent sales lines.
The Price column type in SalesPrice table is float and I run this sentence for one row that
stores in the field Price the value 56.705
SELECT Price, Round(Price, 2) AS RPrice, Round(56.705, 2) AS RDirect WHERE Id = 15949(irrelevant)
and the results are:
Price | RPrice | RDirect |
---|---|---|
56.705 | 56.7 | 56.710 |
I don’t understand how it is possible. Any ideas?
Greg Travis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.