Postflop, I calculate my percentage by working out my outs, (the cards I need to win), and multiplying the number of outs I've got by 4 after the flop, and 2 after the turn. Although this method serves as more of a rough estimation than a definite number. Preflop percentages, I don't know how they're done. I tend to make an informed guess, and I usually get it within 5%.