cant get 4x4 keypad to work outside of a float

so this is for a thermal expansion calculator im working on. it works currently, but i want to make some quality of life changes to it.

the issue im running into is that i cant get the keypad to work from the void loop function, but it works just as intended from inside the float function i created.

what am i missing here? im pretty new to coding so any pointers is greatly appreciated.

#include <Arduino.h>
#include <avr/sleep.h>
#include <Keypad.h>
#include <LiquidCrystal.h>
float SCO = 0.0000073;  //thermal expansion coefficient of steel
float CiC = 0.000006;   //thermal expansion coefficient of Cast Iron
float p;  //result of math between finalvalue, temp1 and SCO
float TEMP = A3;  // temp sensor
float tempValue;  //reading from sensor
float temp1;  //change from C to F for calculation
float temp2;  //change from C to F for display 
const int qcTemp = 70; //baseline temp to compare to
float finalValue;  // final numbers spit out from keypad


// for the getKeypadfloat
  int debug = 0;
  float beforeDecimal = 0;  // the number accumulator
  float afterDecimal = 0;
  byte howManyDecimals = 0;
  char keyval;        // the key press
  int isNum;
  int isStar;
  int isHash;
  
  

const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns
char keys[ROWS][COLS] = {
  {'1', '2', '3', 'A'},
  {'4', '5', '6', 'B'},
  {'7', '8', '9', 'C'},
  {'*', '0', '#', 'D'}
};
byte rowPins[ROWS] = { 4, 5, 6, 7};
byte colPins[COLS] = { 8, 2, 3, 9};

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

const int rs = 12, en =13 , d4 = 8, d5 = 9, d6 = 10, d7 = 11;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void setup()
{
  //pinMode(wakePin, INPUT_PULLUP);
  pinMode(TEMP, INPUT);
  Serial.begin(9600);
  lcd.begin(16, 2); 
  lcd.setCursor(0,0);
    lcd.print("Loading.");
    delay(500);
    lcd.setCursor(0,0);
    lcd.print("Loading..");
    delay(1000);
  lcd.setCursor(0,0);
    lcd.print("Loading...");
    delay(1500);
    lcd.clear(); 
  
  float myValueFromKeypad1 = getKeypadFloat();
  float myValueFromKeypad2 = getKeypadFloat();
  
  
}

void loop()
{
  keyval = keypad.getKey();   // <--- THIS DOESNT WORK!?
  if(keyval == 'A'){
   Serial.println("A"); 
  }
}

float getKeypadFloat()
{ 
    
//temps for calculations
tempValue = analogRead(TEMP);            //_____FROM HERE__________
temp1 = (double)tempValue / 1024;
temp1 = temp1 * 5;
temp1 = temp1 - 0.5;
temp1 = temp1 * 100;
temp1 = temp1 * 1.8 + 32;

//temps for display 
tempValue = analogRead(TEMP);
temp2 = (double)tempValue / 1024;
temp2 = temp2 * 5;
temp2 = temp2 - 0.5;
temp2 = temp2 * 100;
temp2 = temp2 * 1.8 + 32; 
  
//deducting temp from baseline temp 
if (temp1 < qcTemp) {
  temp1 = temp1 -= qcTemp;
}
 if (temp1 > qcTemp) {
  temp1 = temp1 - qcTemp;           // if i move this section to void loop
}                                  //then the whole thing breaks. 

  //doing the math
   float i = temp1 * SCO * finalValue;
   float p = i + finalValue;
   
   
  lcd.setCursor(0,1);
  lcd.print ("QC:");
  lcd.setCursor(3,1);
  lcd.print(p,4);
  lcd.setCursor(0,0);
  lcd.print("In:");
    //displaying current temp
    lcd.setCursor(13,0);
    lcd.print("F");
    lcd.setCursor(14,0);
    lcd.print(temp2);           //_______TO HERE_________
  
 // accumulate the part before the decimal
  do
  { 
    keyval = keypad.getKey();    // input the key
    isNum = (keyval >= '0' && keyval <= '9');  // is it a digit?
    if (isNum)
    {
      Serial.print(keyval - '0');
      beforeDecimal = beforeDecimal * 10 + keyval - '0'; // accumulate the input number
      lcd.setCursor(3,0),lcd.print(beforeDecimal,0) ;
      
    }
    
    
    isStar = (keyval == '*');
    if (isStar)Serial.print("."),lcd.print(".");

    //display but ignore illegal presses
     
    {
      //if (keyval == 'A' || keyval == 'B' || keyval == 'C' || keyval == 'D' || keyval == '#')   //<--- if enable this, hitting A will serial print a ? just fine.
        //lcd.setCursor(5,0),lcd.print("?"),Serial.print("?");
    }

  } while (!isStar || !keyval);                          // until a * or while no key pressed

  // accumulate the part after the decimal

  do
  {
    keyval = keypad.getKey();                          // input the key
    isNum = (keyval >= '0' && keyval <= '9');         // is it a digit?
    if (isNum)
    {
      Serial.print(keyval - '0'), lcd.print(keyval - '0');
      afterDecimal = afterDecimal * 10 + keyval - '0';                 // accumulate the input number
      howManyDecimals++; // increment for later use
      
    }

    isHash = (keyval == '#');
     
    

    //display but ignore illegal presses
    

  } while (!isHash || !keyval);{ // until # or while no key pressed

  finalValue = beforeDecimal + (afterDecimal / pow(10, howManyDecimals));
   
    
   
    }

}