If the given value is outside the given min/max bounds, instead of clamping the number (as the clamp function does), this function wraps the value around to the next bound (inclusive).
clamp
import {wrapNumber} from '@augment-vir/common';wrapNumber({min: 0, max: 100, value: 101}); // 0wrapNumber({min: 0, max: 100, value: -1}); // 100 Copy
import {wrapNumber} from '@augment-vir/common';wrapNumber({min: 0, max: 100, value: 101}); // 0wrapNumber({min: 0, max: 100, value: -1}); // 100
@augment-vir/common
If the given value is outside the given min/max bounds, instead of clamping the number (as the
clamp
function does), this function wraps the value around to the next bound (inclusive).