Validate a number inside an IF THEN Action?

I am trying to use regex to validate that a variable is an integer between 1 and n. I was thinking that I could use "matches" then input ^(?:100|[1-9][0-9]|[1-9])$ but that doesn't seem to work. Ideas?

Why use RegEx instead of a calculation?

1 Like

Assuming I haven't missed the obvious -- what's a good way of checking for integeriness? Perhaps if TRUNC(x) = x?

2 Likes

I would have probably used MOD, but I believe it does not work as expected in KM – so I think your solution is probably the simplest.

MOD treats everything as integers, IIRC.

So -- POC time:

Integer Test POC.kmmacros (2.7 KB)

1 Like