In some situations, we can wish to show floating numbers with fixed number of numbers after the decimal point. In this case, ROUND(field, decimal places) can be used. Take a look on given samples:
SET @test = 4.5; SELECT ROUND(@test, 2) AS testRound; -- should return 4.50 SET @test = 4.50; SELECT ROUND(@test, 2) AS testRound; -- should return 4.50 SET @test = 4.23; SELECT ROUND(@test, 2) AS testRound; -- should return 4.23 SET @test = 4.0; SELECT ROUND(@test, 2) AS testRound; -- should return 4.00 SET @test = 4.01; SELECT ROUND(@test, 2) AS testRound; -- should return 4.01