Andy Jr. Andy Jr. - 4 months ago 28
C# Question

How to slice/trim this value?

I am trying to remove the last 6 characters from

because the data has a decimal place and 5 trailing 0s in the database.

sb.Append("<div>" + item.Size + " " + item.Units + "&nbsp;</div>");

ie. item.Size is displayed as 1.00000 and I need it to just be displayed as 1.

This is part of a StringBuilder, and as I'm new to coding, not even sure the right way to go about this.

sb.Append("<div>" + (int)item.Size + " " + item.Units + "&nbsp;</div>");