Taking the continued fraction approximations of your decimal expansion until the denominators get larger than 10^N ought to work.
Edit: Let me add that you have to do a tiny bit more work to get the best rational approximants from the continued fraction, and that's probably the algorithm that should be used. See http://en.wikipedia.org/wiki/Continued_fraction#Best_rational_approximations

