Minimum number of digits in number field

Minimum number of digits in number field

Hi,
 
I need help with two questions that i have on the number field in the form.
 
1. In the number field of a form, we can validate the max. number of digits. Can someone tell me how we can validate that the field contains exactly (say) 5 digits?
 
2/ Similarly, how do we validate that the field contains both a minimum and maximum number of digits.
 
cheers,
KM