troubleshooting Question

How to strip off numbers after the first decimal place?

Avatar of techques
techques asked on
.NET ProgrammingASP.NET
7 Comments1 Solution515 ViewsLast Modified:
Hi

Here are the decimal:
1600.15
200.46
12.89

How can I strip off the 2nd decimal place to make those decimal to be:
1600.1
200.4
12.8

I have the following code to return bool if it is more than one decimal place.

But, how can I strip off and return the one decimal place number in VC#?
public bool CheckDecimal(string number)
        {
            bool isValid = true;
            if (number.Substring(number.Length - 1, 1) != ".")
            {
                isValid = false;
            }
}
ASKER CERTIFIED SOLUTION
philipjonathan

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros