If your tank is a long style tank or a tall style tank, you should at least consider the surface area calc instead. For instance, i have a 20 gallon long, it is 30"x12"x12". When i do a surface area calculation, it can support 30 inches of fish as opposed to the 20 the inch per gallon rule says. (And yes i am aware that i have over that in the tank, i only asked for 10 cardinals but i wasn't going to return the extras and they have very little bioload.) If i had a regular 20 gallon tank i would have less surface area and hence could not keep as many fish since the water's O2 content is largely dependent on air exchange at the surface, and more surface area = more air exchange. If your tank is a tall or hex style it becomes very important that you take the surface area into consideration when stocking.
To do a surface area calc, multiply the length times width (not depth) of the tank and divide the answer by 12. (example from my tank: 30x12=360 square inches, divide that by 12 and you get 30" of fish) If you have a hex tank you'll need to determine the surface area and divide by 12, i can't remember my geometry to provide the formula for hexagon surface though.
You also need to take bioload into consideration. Large fish are messier, and the inches of fish in these calcs only applies to small bodied fish that don't get larger than 3 inches or so. Larger bodied fish produce more waste and need more water per fish to dilute the waste. Also, the inches of fish refers to their ~adult~ size, not their current size.
When you are working out how you are going to stock it would be good to figure out what you want when your tank is maxed and get some opinions on whether it will work in your particular tank. Happy fishkeeping!