I was reading an otherwise excellent crime novel (it will remain anonymous) that used ".9mm" to describe a handgun. It also called a rifle a "30.06." Both stopped my eye as a reader and took me out of the story because both are incorrect.
The right way is "9mm" and ".30-06."
It can be confusing, so here are three rules of thumb when writing any firearm.
1) If there's a "mm" after it, there's no "." before it. Common examples would be 7mm (a rifle) and the 9mm (a handgun). The rule applies even with convoluted calibers like the 7.62x39mm.
2) For handguns and rifles when there isn't a "mm" (that stands for "millimeter," by the way), there's always a "." before it. So it's .22, .223, .270 and the like. If the number is busted up, it's divided by a "-" and not a "." as in .30-06.
3) Shotguns are a little different since they're sorted by gauges. They're written like "12 gauge" or "12-gauge" and "20 gauge" or "20-gauge." Just be consistent. The .410 is different since it's the runt of the litter, and is actually identified as a caliber.
Make sense? Yes? No? Leave me questions in the comments.