clamp method

void clamp(
  1. int min,
  2. int max
)

Clamps the numeric value between min and max.

Example:

counter.clamp(0, 10);

Implementation

void clamp(int min, int max) {
  value = value.clamp(min, max);
}