How do I round down to the nearest 10?

@Domhell

I try to make it possilble to round a number that is not a comma :blush: problem…

but taking the first number, with extra a nummeric 0 is not possible

BUT I found ‘round down’
BUT IS THIS ONLY FOR COMMA NUMBERS?

Please who can help me: because teacher in school only first let children do maths with the T (first number with zero) and than the rest…

1 Like

@karelrosseel82 I’ve moved this question to its own topic since it specifically concerns using the round block.

The first question in your screen shot asks:

"is round down only for numbers like 3.1 i.e. decimal numbers"

Yes, all 3 of these options expect a comma number (decimal number) and return an appropriate whole number (integer).

rounding

To test a block like this for yourself you can create a new test project and do something like this:
testing

If you now preview this in Thunkable Live you can try out different combinations of number and rounding for yourself.

For example:

  • round(6.1) = 6
  • round(6.8) = 7
  • round_up(6.1) = 7
  • round_up(6.8) = 7
  • round_down(6.1) = 6
  • round_down(6.8) = 6

Your second question then, is something like:

"Can I disregard the ones value of a number, i.e round down to the nearest tens value?

Again, this is pretty straightforward if you break it down into smaller pieces.

  • The first thing is to divide your number by 10, thus 61 becomes 6.1, 68 would become 6.8
  • Next, round down the result of this calculation so 6.1 becomes 6 and 6.8 also becomes 6
    *Finally, multiply the answer by 10 to get 60

round_to_nearest_10

Hope that helps.

3 Likes

It worked perfectly, thank you very much

image

here is my example
https://x.thunkable.com/copy/c35abb225e0ecb3efee8b3c599e48d49

I will make it fansier also

Greetings
Karel

1 Like