Try this
SELECT CONVERT(DECIMAL(10,2),YOURCOLUMN)
such as
SELECT CONVERT(DECIMAL(10,2),2.999999)
will result in output 3.00

Try this
SELECT CONVERT(DECIMAL(10,2),YOURCOLUMN)
such as
SELECT CONVERT(DECIMAL(10,2),2.999999)
will result in output 3.00

Use Str() Function. It takes three arguments(the number, the number total characters to display, and the number of decimal places to display
Select Str(12345.6789, 12, 3)
displays: ' 12345.679' ( 3 spaces, 5 digits 12345, a decimal point, and three decimal digits (679). - it rounds if it has to truncate, (unless the integer part is too large for the total size, in which case asterisks are displayed instead.)
for a Total of 12 characters, with 3 to the right of decimal point.
t sql - T-SQL Format integer to 2-digit string - Stack Overflow
mysql - Display two digits after decimal point in SQL from average value - Database Administrators Stack Exchange
How to display two digits after decimal point in SQL Server - Stack Overflow
Convert day to 2 digits
Switch your AVG and CAST. Instead of
SELECT AVG( cast(`page_rate` as decimal(10,2)))
Use
SELECT CAST(AVG(`page_rate`) as decimal(10,2))
Then you are casting your average with 2 decimal places.
That's a formatting problem. So use FORMAT():
SELECT FORMAT(123.4567, 2); --> 123.46
select cast(your_float_column as decimal(10,2))
from your_table
decimal(10,2) means you can have a decimal number with a maximal total precision of 10 digits. 2 of them after the decimal point and 8 before.
The biggest possible number would be 99999999.99
You can also do something much shorter:
SELECT FORMAT(2.3332232,'N2')
Try this one -
DECLARE @i FLOAT = 6.677756
SELECT
ROUND(@i, 2)
, FORMAT(@i, 'N2')
, CAST(@i AS DECIMAL(18,2))
, SUBSTRING(PARSENAME(CAST(@i AS VARCHAR(10)), 1), PATINDEX('%.%', CAST(@i AS VARCHAR(10))) - 1, 2)
, FLOOR((@i - FLOOR(@i)) * 100)
Output:
----------------------
6,68
6.68
6.68
67
67
You could cast it to DECIMAL and specify the scale to be 2 digits
decimal and numeric
So, something like
DECLARE @i AS FLOAT = 2
SELECT @i / 3
SELECT CAST(@i / 3 AS DECIMAL(18,2))
SQLFiddle DEMO
I would however recomend that this be done in the UI/Report layer, as this will cuase loss of precision.
Formatting (in my opinion) should happen on the UI/Report/Display level.