bind a value between a min and a max