What would be the result of this?
#1

Do I have to convert that to a float instead or would it work if it was something like 2.3 ?
Apologies, been away for a couple of months. Rusty.

pawn Код:
hoursplayed = LastPayday[playerid] / 60
Reply
#2

Int divided by int remains int. Any would-be fractional part is discarded (not rounded), e.g. 10 / 6 = 1.
Reply
#3

Ahh Thanks. so Float isn't necessary?
Reply
#4

you won't need float for that since hours and days are called by integer values which does not need fraction a fraction. So no

unless you want a float solution to that yes you will need it.

but on account of your solution that would somehow give a float as an answer at somepoint such 24/60 = 0.4 which is a float and since your solution does not consider float's it would call for an integer and the value would be zero because it follows the round rules if higher than five plus one if lower than five remain.
It would be safe to say that float is also needed.

Now look at how you would use it, how you would want it to work.

a.)Do you want it to calculate the float numbers and use those float numbers on something else on your script?

b.)or is it already complimentary to have an integer because you are sure that you don't need the float
and that your value is higher than 1 because if it is below one then it would surely give you a value of zero, on my understanding.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)