Skip to content

Tag: decimal

set decimal places of sum in sql

I have a database I use for a debating competition I am trying to sort the standings out to see which schools will play off in the finals at the end of the semester. I have this working as shown below however I am not able to round the ptc field, it currently returns up to 4 decimal places eg

Remove trailing zeros from decimal in SQL Server

I have a column DECIMAL(9,6) i.e. it supports values like 999,123456. But when I insert data like 123,4567 it becomes 123,456700 How to remove those zeros? Answer A decimal(9,6) stores 6 digits on the right side of the comma. Whether to display trailing zeroes or not is a formatting decision, usually implemented on the client side. But since SSMS formats