Handbook
Glossary
v-integer ( str -- n )
Form validators
Prev:
v-number ( str -- n )
Next:
v-one-line ( str -- str )
Vocabulary
validators
Inputs
str
a
string
Outputs
n
an
integer
Word description
Converts the string into an integer, throwing a validation error if the string is not a valid integer.
Definition
USING:
kernel
math
;
IN:
validators
:
v-integer
( str -- n )
v-number
dup
integer?
[
"must be an integer"
throw
]
unless
;