I'm trying to research this simple operation, and I'm coming up with nothing for it. I want to be able to find a place value for an integer, and I'm wondering if there is a specific gem or operation for it. For example:
a = 1651684651
p find_place_value_of(a,5) # imaginary function to return the value of the
# number in the 10000 column
# output should be 8
So far the best I have been able to do is come up with this ugly little function:
j= 262322
a= j
a/=100000
b= j - a*100000
b/=10000
c= j - a*100000 - b*10000
c/=1000
d= j - a*100000 - b*10000 - c*1000
d/=100
e= j - a*100000 - b*10000 - c*1000 - d*100
e/=10
f= j - a*100000 - b*10000 - c*1000 - d*100 - e*10
p a,b,c,d,e,f,j
Is there a more elegant way of finding a place value?