Get First N Digits of a Number

I was asked by my senior colleague to make a method which takes two arguments as input, first the number and second the number of digits to be returned from the first argument number, but the restriction was not to convert it to string. 
  1. private static int takeNDigits(int number, int N)    
  2. {    
  3.     // getting number of digits on ths input number  
  4.     int numberOfDigits = (int)Math.Floor(Math.Log10(number) + 1);    
  5.       
  6.     // check if input number has more digits than the reuired get first N digits  
  7.     if (numberOfDigits >= N)    
  8.         return (int)Math.Truncate((number / Math.Pow(10, numberOfDigits - N)));    
  9.     else    
  10.         return number;    
  11.     
  12. }    
I tested with some inputs which are : 
  1. int Result1 = takeNDigits(666, 4);    
  2. int Result2 = takeNDigits(987654321, 5);    
  3. int Result3 = takeNDigits(123456789, 7);    
  4. int Result4 = takeNDigits(35445, 1);    
  5. int Result5 = takeNDigits(666555, 6);    

the output was:

Result1 : 666
Result2 : 98765
Result3 : 1234567
Result4 : 3
Result5 : 666555