Method CoerceValue
CoerceValue(double, double, double)
Forces the value to stay between minimum and maximum.
public static double CoerceValue(this double value, double minimum, double maximum)
Parameters
Returns
- double
Minimum, if value is less than minimum. Maximum, if value is greater than maximum. Otherwise, value.
CoerceValue(int, int, int)
Forces the value to stay between minimum and maximum.
public static int CoerceValue(this int value, int minimum, int maximum)
Parameters
Returns
- int
Minimum, if value is less than minimum. Maximum, if value is greater than maximum. Otherwise, value.