I have this in one of my queries:
FORMAT(ROUND(AVG(`rating` * 2)) / 2, 1) AS `average_rating`
If rating has a value of, say, 1.45 – then I get 1.5, which is what I want. When it rounds to whole numbers, I get 1.0, 2.0, etc. I don’t want that. When I get whole numbers, I’d like to drop the decimal value.
Is there a way to do this in MySQL?
Try in this way :