hey man, grabbing the number should not be the outcome of the interaction - rather, it should be a byproduct of it.
if you leave right after you get the number, you are communicating to her that you were not there to get to know her...you were only there to get her number.
As a result, if time permits, I usually like to hang around for a few minutes after I get the number. Then I tell her I gotta get going and go on my way.
One thing that makes grabbing a number super easy is finding out something you really like about the girl when you're talking with her. Then, on an emotional high point (this is important), you say,
hey, i really like that youre so self improvement oriented/caring/adventurous. we should grab a drink sometime
That way she A) understands that you like her and b) understands you want to see her again for reasons other than her looks. If she says yes, hand her your phone and get her to put her # in so you guys can arrange logistics.