Check if input will behave as an integer:
Unfortunately, (isint 5fdsf) returns 1 because in CubeScript, 5fdsfs = 5. This works for math but not much else.
If you need an integer without any junk, just add 1 and subtract 1 to the number, or use Bukz' checkint.
Edit: NVM don't use this as it doesn't count 0 as a number.
Bukz Edit: \:D
[SELECT ALL] Code:
isint = [result (&& (!=f (divf $arg1 1) 0.0) (=f (modf $arg1 1)) 0) ]
Unfortunately, (isint 5fdsf) returns 1 because in CubeScript, 5fdsfs = 5. This works for math but not much else.
[SELECT ALL] Code:
a = 5dfsdfs
b = 5
echo (+ $a $b) //output: 10
echo $a //output: 5dfsdfs
If you need an integer without any junk, just add 1 and subtract 1 to the number, or use Bukz' checkint.
[SELECT ALL] Code:
a = 5fsdsfd
a = (- (+ $a 1) 1)
Edit: NVM don't use this as it doesn't count 0 as a number.
Bukz Edit: \:D