26.12.2017, 21:20
Yes, it does return 0 because inside the floatround function you have 3 integers, if you want to do that, you should use this
now, num1 becomes a float, so you have at least one floating number in that operation, and it is enough. (when you divide a float with an int or vicevers the result it's a float, in your code you divide 2 integers, and the result is 0 if num1<num2)
BUT!
why not simply do this:
?
Quote:
floatround( float(num1)/num2 * 100); |
BUT!
why not simply do this:
Quote:
new percents = num1*100 / num2; |