Check integer or decimal

How can I check that value entered in text box is a integer or a decimal value

1 Like

Why not using the “is string” and the “is number” block?

Yoshi

1 Like

I would do something like this :

blocks (4)

You check if when you round the number, the number change, so it’s decimal

4 Likes

No you just check like this if it’s a number or a string, that’s not what he asked for

1 Like

You may want to use
blocks (1)

3 Likes

well, if the user just text for example 28. without indicating something after coma, it will be shown as a decimal, while it’s not really isn’t it?

1 Like

if there is a full stop then it is not a number.

1 Like

Tested, try this
blocks (2)
It should return true we there’s nothing after “.”

3 Likes

well i think @TRICKY_MIND you have at least 2 solution :slight_smile:

1 Like

who is @TRICKY_MIND

The guy that created the subject :slight_smile:

He is OP:
image

Well, you didn’t know his name but posted the solution. O-Ok…

1 Like

… I forgot already
Edit I thought it is another guy lololloolool

2 Likes

Actully this won’t work because


I mean this

1 Like

It was my mistake :sweat_smile:

There are multiple solutions and this is one of them:
image

3 Likes

That was what I think of first but eventually I realize that you can simply use text component.
However the number shd be 1 not 0

Well tested, and it works fine for me.

How??? I quite do not understand what was your mistake…

I marked @WatermelonIce 's post as solution in confusion…

1 Like

Don’t take this away from me :sob:
jk