Question: nth digit of Pi

Hi, please help me to improve my clumsy code. I want a procedure that gives me the nth digit of Pi. I guess there's a much better way to do this, right ?

nthpi:=proc(n)
 Digits:=n+1: # make sure enough digits are available
 evalf(Pi,n+1);  # eval one digit more because the last one is rounded
 op(1,%);# make it integer
 convert(%,base,10); # convert integer to list of Pi-Digits
 op(2,(%)); # pick up the first not rounded digit
 end proc;

nthpi(4);

Please Wait...