Float returning 0?

BlitzMax Forums/BlitzMax Beginners Area/Float returning 0?

Ant(Posted 2006) [#1]
Hmm, I know I must be doing something really stupid, here is my code:


Now number is returning 55, (COLUMNS*ROWS) = 70 but percentage is equalling 0.0!?!?!

Where is the obvious error? ;-)
cheers


anawiki(Posted 2006) [#2]
Use type casting:
p:Float = (float(number) / (columns*rows))*100


Ant(Posted 2006) [#3]
excellent - thanks