The pumps don’t, to be exact. It’s the electronic stuff on the console that the cashier has. The cashier enters:
a) type of gas (diesel, unleaded, super unleaded, etc.)
b) pump number
c) maximum $ amount before pump stops
When you go to fill the tank at the pump number, it will let the gas flow up to the dollar amount. In my experience it is inexact – if you say $20.00, it may not click off until $20.02 or $20.03 or so.