Input text box

I want to make sure that a dynamic text box never went over 2400, and when it normally would go over 2400, it would subtract that from itself.

e.g. instead of 2500, make the dynamic text box say 100