[SOLVED] Conversion from reading character into 6-digit number not working

Why is this conversion from reading 6 characters into a 6-digit number not working?
IDE 1.8.4, Win10, Mega2560.

To run, enter
p0xxxxxx where xxxxxx are the 6 digits
I am trying to make a limit test where once the value exceeds 230000 decimal, it is assigned the value 230000, to prevent any typos from allowing weird things to happen later on.
Yet if I enter 240000 and above, the calculation of the number goes odd.

byte x;
byte command = 0;
byte moveCommand;
byte goodCommand = 0;
byte goodMotor = 0;
byte motorToMove; // the motor commanded to move
byte charStep[6];


unsigned long goToPosition;
unsigned long maxPosition = 230000; // max extension
unsigned long minPosition = 0; // min retraction


void setup() {
  // Turn on Serial
  Serial.begin(115200);
  Serial.println ("Ready to Go.");
}
void loop() {
  if (Serial.available() > 1 ) { // read 2 bytes
    // if p/P, #0 to 15, then 6 chars, turn into a # 0 to 230,000


    command = Serial.read(); // u/U = up, d/D = down, s/S = stop, p/P = position
    Serial.print (" loop command ");
    Serial.println (command);
    motorToMove = Serial.read(); // , later convert to 0 to 9 then :(10) ;(11) <(12) =(13) >(14) ?(15) for serial monitor test
    if (( command == 'p' || command == 'P') && (motorToMove >= '0' && motorToMove <= 'F')) {
      // good command, good motor#
      goodCommand = 1;
      goodMotor = 1;
      motorToMove = motorToMove - 48; // ASCII to decimal for 0 to 9
      if (motorToMove > 9) {
        motorToMove = motorToMove - 7; // further ASCII  to decimal for A to F
      }
      Serial.print (" Motor # ");
      Serial.print (motorToMove); // should be 0 to 15 now
    }
    else {
      goodCommand = 0;
      goodMotor = 17;
      //Serial.println ("bad command or motor");
    }
    if (command == 'p' || command == 'P') {
      Serial.print (" Move to ");
      //upDown = 4;
      //motorCommand[motorToMove] = 4;
      moveCommand = 0xB; // need 5 characters still for 230,000
      // get 6 characters
      while (Serial.available() < 5) {
        // wait for more characters
      }
      // got 6, continue
      for (x = 0; x < 6; x = x + 1) {
        charStep[x] = Serial.read() - 48; // read order is FEDCBA
        Serial.print (charStep[x], DEC);
      }
      goToPosition =(charStep[0] * 100000) + (charStep[1] * 10000) +(charStep[2] * 1000) +(charStep[3] * 100) +(charStep[4] * 10) + charStep[5];
      Serial.print (" position: ");
      Serial.println (goToPosition, DEC);
    }
  }
}

(Off-topic: It would also be great if ‘p’ printed back as the command instead of 112, but the Serial.print() doesn’t seem to support doing that, that I could find.)
Results Examples:

Ready to Go.
 loop command 112
 Motor # 0 Move to 100000 position: 100000
 loop command 112
 Motor # 0 Move to 200000 position: 200000
 loop command 112
 Motor # 0 Move to 230000 position: 230000
 loop command 112
 Motor # 0 Move to 231000 position: 231000
 loop command 112
 Motor # 0 Move to 232000 position: 232000
 loop command 112
 Motor # 0 Move to 233000 position: 233000
 loop command 112
 Motor # 0 Move to 234000 position: 234000
 loop command 112
 Motor # 0 Move to 240000 position: 174464
 loop command 112
 Motor # 0 Move to 250000 position: 184464
 loop command 112
 Motor # 0 Move to 260000 position: 194464
 loop command 112
 Motor # 0 Move to 270000 position: 204464
 loop command 112
 Motor # 0 Move to 280000 position: 214464
 loop command 112
 Motor # 0 Move to 290000 position: 224464
 loop command 112
 Motor # 0 Move to 231000 position: 231000
 loop command 112
 Motor # 0 Move to 232000 position: 232000
 loop command 112
 Motor # 0 Move to 233000 position: 233000
 loop command 112
 Motor # 0 Move to 234000 position: 234000
 loop command 112
 Motor # 0 Move to 235000 position: 235000
 loop command 112
 Motor # 0 Move to 236000 position: 236000
 loop command 112
 Motor # 0 Move to 237000 position: 237000
 loop command 112
 Motor # 0 Move to 238000 position: 238000
 loop command 112
 Motor # 0 Move to 239000 position: 239000
 loop command 112
 Motor # 0 Move to 240000 position: 174464
 loop command 112
 Motor # 0 Move to 100000 position: 100000
 loop command 112
 Motor # 0 Move to 200000 position: 200000
 loop command 112
 Motor # 0 Move to 230000 position: 230000
 loop command 112
 Motor # 0 Move to 231000 position: 231000
 loop command 112
 Motor # 0 Move to 232000 position: 232000
 loop command 112
 Motor # 0 Move to 233000 position: 233000
 loop command 112
 Motor # 0 Move to 234000 position: 234000
 loop command 112
 Motor # 0 Move to 240000 position: 174464
 loop command 112
 Motor # 0 Move to 250000 position: 184464
 loop command 112
 Motor # 0 Move to 260000 position: 194464
 loop command 112
 Motor # 0 Move to 270000 position: 204464
 loop command 112
 Motor # 0 Move to 280000 position: 214464
 loop command 112
 Motor # 0 Move to 290000 position: 224464
 loop command 112
 Motor # 0 Move to 231000 position: 231000
 loop command 112
 Motor # 0 Move to 232000 position: 232000
 loop command 112
 Motor # 0 Move to 233000 position: 233000
 loop command 112
 Motor # 0 Move to 234000 position: 234000
 loop command 112
 Motor # 0 Move to 235000 position: 235000
 loop command 112
 Motor # 0 Move to 236000 position: 236000
 loop command 112
 Motor # 0 Move to 237000 position: 237000
 loop command 112
 Motor # 0 Move to 238000 position: 238000
 loop command 112
 Motor # 0 Move to 239000 position: 239000
 loop command 112
 Motor # 0 Move to 240000 position: 174464

 loop command 112

 Motor # 0 Move to 239999 position: 239999

 loop command 112

 Motor # 0 Move to 240000 position: 174464

[/code]

Printing 'p' rather than 112:

  Serial.println ((char)command);

Getting the calc right:

      goToPosition = (charStep[0] * 100000UL) + (charStep[1] * 10000UL) + (charStep[2] * 1000UL) + (charStep[3] * 100UL) + (charStep[4] * 10UL) + charStep[5];

Thanks wildbill, that seems to do it. I had tried putting (long) and long ( ) in there to no avail.
Been a while since I did any math like that, had forgotten but UL at the end of a number.