Closed s-hadinger closed 3 months ago
Follow-up on #431
int() has new parameters min and max to guard value between both values.
int()
min
max
int(val:any [, min:int, max:int]) -> int or nil: the value is forced to be between min and max (see unit tests)
int(val:any [, min:int, max:int]) -> int or nil
Example:
var b = int(a, 0, 10)
is more or less equivalent to:
var b = int(a) if (a < min) a = min end if (a > max) a = max end
Follow-up on #431
int()
has new parametersmin
andmax
to guard value between both values.int(val:any [, min:int, max:int]) -> int or nil
: the value is forced to be betweenmin
andmax
(see unit tests)Example:
is more or less equivalent to: