I have a variable that divides by 10. So, say I have 75, divided by 10=7.5. I want to turn it into a whole number without making it round up. So if I have 7.9, I want it to round to 7. 2.5 rounding to 2, 5.7 to 5, etc.
Any ideas?
Offline
that would be called finding the integer value. its a shame there isnt an interger function on scratch but there is a technique you can use.
use the round function on the number minus 0.5. so for 5.7 try: round(5.7-0.5) this becomes 5.2 which rounds down.
hope this helps.
Offline
bigB wrote:
that would be called finding the integer value. its a shame there isnt an interger function on scratch but there is a technique you can use.
use the round function on the number minus 0.5. so for 5.7 try: round(5.7-0.5) this becomes 5.2 which rounds down.
hope this helps.
Thank you so much!
Offline