The numbers I used were only an example but the method is correct. The example you're using works out because you are multiplying by ten. The fact that it ends up being 310 is purely coincidental. You have to divide the number of teeth on the ring gear by the number of teeth on the pinion to calculate the gear ratio.
Think about it.......if the ring gear has 36 teeth and the pinion has 12 teeth, the pinion has to turn 3 times before the ring gear will make a full rotation......thus the 3.00:1 ratio. By your method of multiplying, the ratio would be 432 which isn't even a ratio at all.
If you divide the number of teeth on the ring by the number of teeth on the pinion, 36/12, it yields the gear ratio of 3.00:1.....meaning the driveshaft will spin 3 times for every complete tire rotation. Division is the only way to figure it.