Convert a fractional gallon amount to nearest 0.05

In converting Liters to Gallons, I have a problem with the rounding not working. I would get 5.01 gallons, instead of 5.00 gallons. But I also want to allow quarts, like 5.25. I made and used this page to refine the rounding.

Volume (gallons) Volume (rounded to nearest 0.05)




This page gives approximate answers. Do not rely on it.
-Michael Weeks, mweeks [at] cs.gsu.edu, copyright 2015.