Reputation: 44719
How to round with no trailing zeros in SQL Server 2005?
select round(100.5555, 2)
...yields 100.5500. How to get rid of the zeros?
Upvotes: 11
Views: 27904
Reputation: 102478
You could re-cast it as your original datatype, e.g.
SELECT CAST(ROUND(100.5555, 2) AS FLOAT)
However, this sounds like display logic and therefore, I suspect you are better off doing this within your UI rather than your DB.
Upvotes: 9
Reputation: 166396
Try this
select CAST(round(100.5555, 2) AS DECIMAL(8,2))
Upvotes: 17