Reputation: 2483
How would I convert this number (42519.36) to a whole real number (5)?
42519.36 = 5
What is the most efficient way in C#?
Thanks!
Upvotes: 3
Views: 4078
Reputation: 108830
Use the remainder operator:
int hundredDigit=(int)Math.Abs(number/100%10)
Upvotes: 14