clamp method

num clamp(
  1. num lowerLimit,
  2. num upperLimit
)

Clamps the validated number to be within the range lowerLimit, upperLimit.

Implementation

num clamp(num lowerLimit, num upperLimit) {
  return validate().clamp(lowerLimit, upperLimit);
}