Thread: TypeCasting
View Single Post
Old 10-27-2012, 01:04 AM   PM User | #2
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,220
Thanks: 4
Thanked 80 Times in 79 Posts
Spookster will become famous soon enough
This doesn't make sense. You would see why this isn't working if you run it in a debugger and look at what is happening with each value.

percentage = (double)total/ occupiedTotal;

Why are you using int type here for all 3 variables? And why are you trying to typecast one of them?
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
Spookster is offline   Reply With Quote