private decimal Check (decimal val) { decimal ret = val; if (ret < minimum) { ret = minimum; } if (ret > maximum) { ret = maximum; } return ret; }