Keypad input. Char to uint32? Trying to get input to be a 8 digit number long

Sorry for cryptic title, don’t really know how to describe my problem. I’ve tried various methods.

I have code which takes input from the keypad as a char array. I need to convert this to a uint32 to then change a vfo frequency module.

This is a sample code I made up but it doesn’t work as I expected. On the serial monitor I can see the char input and also the next ASCII representation of the ‘vfo’.

Comments in code show my points where I am checking to see whats actually happening.

‘vfo’ needs to pass to another display frequency routine. This should be an 8 digit figure i.e. 14235000
I would like to limit the input to 8 characters.

Thanks for any pointers.

 uint32_t vfo
 uint32_t freq_n;
void readKeypad()
  char key = keypad.getKey();
  if (key != NO_KEY)
  {  lcd.print("                  "); // clears top line only, to show input from keypad
    lcd.print(new_freq);    // echo to lcd

     case '*':   // if star is entered then process
      freq_n = atoi(new_freq);
      Serial.print(new_freq);  // echo to monitor
      vfo = (freq_n);          // set vfo as frequency
    Serial.print(vfo);       // shows ASCII string ??
     z=0;                   // reset array count
     display_frequency();   // display frequency
     display_band();        // display band
     delay (5000);          // pause to see what's happening
      for( int i = 0; i < sizeof(new_freq);  ++i )  // clear array
       new_freq[i] = (char)0;                       //
    case '#':               // clear and resume
       for( int i = 0; i < sizeof(new_freq);  ++i )  // clear array
       new_freq[i] = (char)0;                       //
       display_frequency();                         // return to normal
    //  lcd.print("                  "); 

have you been through Serial Input Basics yet?

?? I'm not using Serial, only the serial.print to the monitor to check what i was getting from the program. Rob

OK sorted.

It appears atoi provides an ASCII representation. Whereas atof will provide me with the right value.

Now working.