Math.Round down???

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

I would like to round to the whole number. For example 12.98 I would
like this to round to 12. The current statement I have is:

TopSquareRoot = Math.Round(TopSquareRoot);

TopSquareRoot is a Double.

How do I do this?

Thanks in advance - Dan
 
Use Math.Floor() to accomplish this.

TopSquareRoot = Math.Floor(TopSquareRoot);

should do the trick.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Math.Round problem 10
money round 2
Discrepancy between Math.Round and ToString( "F" ) method 6
Round 3
Math.round 1
Round function? 3
Custom decimal round 14
understanding Math.Ceiling 7

Back
Top