I think it depends on the breed of fish as some fisg need more space than others and soe fish toy can only have one of in the tank because they fight
here's a volume claculator
http://www.ifocas.org/calculator.htm
Make sure you extract the space the substrate will take up and the space on top of the water to the top of the tank. Usually about 20% of the total volume.
As per what woofgang said, there used to be a rule of thumb of 1 inch of fish per gallon but with the improved filtration systems this can be exceeded with suitable tropical community fish. Better be safe than sorry.