Providing Customer with a price depending on size

Hey,

My business sells engineering parts. For one of the parts, customers purchase specific sizes right down to the millimetre. I charge per 100mm (£2 each if size is between 200-300mm, £3 each if size is 301-400mm).

I want to provide my customer the option to type their size they require e.g. 310mm and to provide them with the cost above. How can I do this?