C# Count decimal places without considering the trailing zeros [closed]

You can use string value=decimalValue.ToString("0.########") this will convert the value into a string and show up to 8 decimal places, without trailing zeros. Eg. 1.05000000 – > 1.05, 1.00000001->1.00000001. Then value.Split('.').ToList().ElementAt(1).Length

Browse More Popular Posts

Leave a Comment