how to 'cap/limit' a number?

Thanks for the help!