Check if a number is less than modulo (SOLVED)

Greetings,

I’m trying to type a certain formula for testing, but I couldn’t quite wrap my head around it.

I got stuck here:

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

I’m not positive that I understand but how about…

(compare 2 numbers)

You might not need the condition . IDK what your goal is.

2 Likes

image

"Number "+ActualNumber+"
Equation Output "+ToString(floor(ActualNumber/10))+"
Output ONE Digit "+ToString(mod(floor(ActualNumber/10),10))


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

If you remove the mod() condition then it would show the number regardless of whether it was divisible by a certain number. Is that what you want?

You could replace it with a less than or other conditions.

1 Like

Woah, yes, that’s it! It works just like I want it to now
Thanks!

1 Like