Sometimes a pattern gives you selvedge stitches to add to the stitch count. I generally assume that if you're making a sweater, for example, the row of stitches on the edge of the piece--even if they're treated as part of the pattern--are for seaming, so the finished circumference of the piece doesn't include them. So for a sweater, I'd take four stitches away from the total count--unless they're needed for the continuity of the design. I don't make sweaters that are so fitted that four stitches makes much of a difference, though, so if they're left in, it really doesn't matter.
For a hat, though, I'd take out two stitches if I wanted to convert a straight pattern to flat.
is an excellent reference for knitting any basic hat in the round, and this
site has so many free patterns that conversion is probably only a last resort.