Basically, what I want to do is simple. I’m using modulo to check for numbers divisible by 10. If the number is less than 10, return 1. If the number is less than 20 but greater than 10, return 2. If the number is less than 30 but greater than 20, return 3, and so on.
I want to try and do this with as little code as possible since that’s generally a good practice.
Could somebody please point me in the right direction? Thanks
Thanks, I have something promising so far. When I type a number that’s divisible by 10, it now shows me that value. I never would’ve thought to truncate.
However, I do still have a problem.
I would like to check if the number is divisible by 10 or less. For example, if the number entered is less than 10, show 1. If it’s less than 20, show 2, and so on.
So far, it will only change if the number is divisible by 10 and nothing more.
How would I check if the typed value is divisible by 10 or less?
And well, let’s say it doesn’t have to be 10 specifically. 10 could be any number, so I just need the code to check if the number is less than the divisible number.
I’m not sure if that’s the best way to explain it, but that’s sort of what I’m after