I am having problem to format digits in my select column.I used FORMAT but it doesn\'t work. Here is my column:
sum(cast(datediff(second, IEC.CREATE_DATE, IEC.ST
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