Thomas Kurz, on Friday, May 24, 2019 09:13 AM, wrote...
>Sorry, but even Excel (which usually isn't very good at decimal math) gives 
>correct results:
>
>ROUND(3.255;2) --> 3.26
>ROUND(3.25499999999999;2) --> 3.25

FWIW, I went to sqlfiddle [1] and these are the answers for this SQL command:

SELECT round(3.255,2), round(3.2549999999999998,2);

for MySQL 5.6, answer...
round(3.255,2) | round(3.2549999999999998,2)
3.26 | 3.25

PostgreSQL 9.6, answer...
round | round
3.26 | 3.25

SQLite (SQL.js), answer...
round(3.255,2) | round(3.2549999999999998,2)
3.25 | 3.25

MS SQL Server 2017, answer...
 |
3.26 | 3.25

I could not get Oracle to work. But, it looks like MySQL, PostgreSQL and MSSQL 
provide correct output. By the way, the SQLite version on this site is old 
(3.15.1). Thanks.

josé

[1] http://sqlfiddle.com/#!9/a0753b/3
[http://sqlfiddle.com/images/fiddle_transparent.png]<http://sqlfiddle.com/#!9/a0753b/3>
SQL Fiddle | A tool for easy online testing and sharing of database problems 
and their solutions.<http://sqlfiddle.com/#!9/a0753b/3>
Application for testing and sharing SQL queries.
sqlfiddle.com

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to