I have this SQL script below:
select round (72.396, 2)
What I expect like result is: 72.39.
I don’t want to round the number.
if I use the select round(72.396, 2)
the result I get is: 72,40
How can I have what I expect without rounding using Mysql?
Advertisement
Answer
You need to use the truncate
function instead of round
:
SELECT TRUNCATE(72.396, 2)
To answer the question in the comment – truncate
just removes any additional decimal places after the number specified in the second argument, without rounding.