int is entered but what if i want the value to be no more than 7 digits
I'm sure you meant a float or double and not an integer because integers are already well-rounded and to limit an integer to less than 7 digits means you limit the integer to an integer less than 10,000,000