MariaDB ROUND() vs TRUNCATE()

MariaDB has a ROUND() function and a TRUNCATE() function that can return the same results or different results, depending on the exact value of their arguments.

As the function names suggest, ROUND() rounds the number and TRUNCATE() truncates the number. Truncating a number simply cuts it off without performing any rounding.

Below is a quick rundown on the difference between ROUND() and TRUNCATE() in MariaDB.

Continue reading