If variable contains only number, how to?

AdamMirow

Новичок
Joined
Feb 4, 2019
Messages
6
Reaction score
0
Points
1
Hello Guys,

I would like to check if a variable is a number. if the variable cointains more then a number like letters or , it should fail. can anybody help please?
 

VladZen

Administrator
Staff member
Joined
Nov 5, 2014
Messages
22,829
Reaction score
6,040
Points
113
This is the task for you logic. Do you know regex that can get numbers from text?
 

AdamMirow

Новичок
Joined
Feb 4, 2019
Messages
6
Reaction score
0
Points
1
This is the task for you logic. Do you know regex that can get numbers from text?
No i dont know. Which task do you mean?
 

EtaLasquera

Client
Joined
Jan 2, 2017
Messages
527
Reaction score
113
Points
43
Execute a text processing Regex into variable who you want to check if is numeric, add this regex to a new variable: {-Variable.regexTest-}
Code:
[A-Za-z]|\W
After execute regex, add a block with test:
Code:
"{-Variable.regexTest-}" == ""
Note: If number contain any type of symbol like decimal separator, the result will be a not numeric.
 

Attachments

Last edited:

Solus

Client
Joined
Apr 14, 2014
Messages
378
Reaction score
120
Points
43
Or you can use this regex \d+ (searching numbers)
 

AdamMirow

Новичок
Joined
Feb 4, 2019
Messages
6
Reaction score
0
Points
1
Thank you very much guys, it works. Perfect!
 

Users Who Are Viewing This Thread (Total: 1, Members: 0, Guests: 1)