I will be 4ft underground if I don't get this to work. I spent 5 days already trying to figure out solutions but is just not working. :(

I need an object that receives two parameters: 1) a number (0 to 99999 "long type") 2) a place number (0 to 5 "int type") with these parameters it returns the digit of the number determine by the place number.

example 1: 1) number: 56789 2) place number: 1 it returns 9

example 2: 1) number: 56789 2) place number: 2 it returns 8

I believe that I made my point, I added my code below. Nevertheless I can't get it to work without overflowing. Any suggestions will be appreciated.

Thanks in advance.

```
int getDigit(long number,int place){
if(place == 1){return (number-((int(number*0.1))*10));}
else if(place == 2){return (int((number-((int(number*0.01))*100))*0.1));}
else if(place == 3){return (int((number-((int(number*0.001))*1000))*0.01));}
else if(place == 4){return (int((number-(long(int(number*0.0001)))*10000)*0.001));}
else{return (int(number*0.0001));}
}
```