That's esentially how I did it I just don't know how many oz in a gallon

Welcome to the American system of weights and measures.

1 pint = 16 oz is common knowledge for beer drinkers (a regular bottle of beer is 12oz)

2 cups = 1 pint

2 pints = 1 quart

4 quarts = 1 gallon

Easy-ish to remember: 2 except the quart is short for quarter so there's 4 of them in the next size.

Now, with smaller volume measure it gets weird ( 3 teaspoons = 1 tablespoon, 16 tablespoons = 1 cup).

And the British system is different. A British pint is 20 oz. From there it's still 2 pints in a quart, 4 quarts in a gallon, so a British quart or gallon is obviously bigger than an American quart or gallon.