Displaying a POT Reading on LCD

Hi All.
First all I am new to Arduino and programming. I’ve been running through code and projects trying to learn how to do this myself.
I have worked with code from others, coded some myself, and have learned a ton.

The reason I wanted to learn is I am in the middle of building a “RAT ROD” with air bagged suspension.
The controller that came with the kit is a ugly plastic piece of junk.
So I made the plan to do something a little cooler. An Arduino controlled Air ride setup with preset ride heights, and Switches and buttons that look cool and fit with the look of the car.

So there are a few coding sketches out there that I have reviewed. Some are close to what I need, but need some tweeking.

So I started with the basics and broke my plan into parts.
-Control a 8 bank of relays - Done
-Control 8 bank of relays with input from a Pot - Done
-Control a 4x20 LCD and have it display each corner POT readout - DONE with issues

So I’m Stumped I’ve finally decided to ask for help.
When reading the Pots, my LCD stores an extra number. I’ve done a bunch of reading and tried using an lcd.print(" ") after and found it just blanks my pot reading. Tried printf and could not get that working.
I’ve tried to convert my Pot reading to % and it still just reads the Pot value.

So how do I get my LCD to read my Pots in % and how do I get rid of the extra number? (Relay code and button code isn’t fully in this part at the moment. Want to get display sorted first)

//Read height sensors on 4 corners, 4 ride sensors on analog pins 0-3
//Air ride control unit attached to digital pin 13-6
//2 Push buttons connected digital Pins 5,4 to set ride heights
//14 Pins controlled by momentary toggle switches using 8 relays 
//Uses 2004A 20x4 LCD screen with Ride Height sensor at each corner

#include <Wire.h>

#include <LiquidCrystal_I2C.h>
 
LiquidCrystal_I2C lcd(0x27,20,4); // 0x27 is the I2C bus address for an unmodified backpack


int LFPot = A0;    //Set LF Bag height sensor input on Analog port 0
int RFPot = A1;    //Set RF Bag height Sensor input on Analog port 1
int LRPot = A2;    //Set LR Bag height Sensor input on Analog port 2
int RRPot = A3;    //Set RR Bag height Sensor input on Analog port 3

      
int LFPotval = 0;          //Set LF Bag sensor to 0 value   
int RFPotval = 0;          //Set RF Bag sensor to 0 value
int LRPotval = 0;          //Set LR Bag Sensor to 0 value
int RRPotval = 0;          //Set RR Bag Sensor to 0 value
     

const int lfupPin = 22;        //LF Bag fill solenoid to Digital Pin 22
const int lfdownPin = 24;      //LF Bag release solenoid to Digital Pin 24
const int rfupPin = 26;        //RF Bag fill solenoid to Digial Pin 26
const int rfdownPin = 28;      //RF Bag release solenoid to Digital Pin 28
const int lrupPin = 30;        //LR Bag fill solenoid to Digital Pin 30
const int lrdownPin = 32;      //LR Bag release solenoid to Digital Pin 32
const int rrupPin = 31;        //RR Bag fill solenoid to Digital Pin 31
const int fupPin = 30;         //Front Bags fill solenoid to Digital Pin 30
const int fdownPin = 29;       //Front Bags release solenoid to Digital Pin 29
const int rupPin = 28;         //rear Bags fill solenoid to Digital Pin 38
const int rdownPin = 27;       //rear Bags release solenoid to Digital Pin 27
const int aupPin = 26;         //all Bags fill solenoid to Digital Pin 26
const int adownPin = 25;       //all Bags release solenoid to Digital Pin 25

const int upbuttonPin = 5;     //Push button to put car at highes level on Digital Pin 5
const int ridebuttonPin = 4;   //Push button to put car at ride height on Digital Pin 4
int upbuttonState = LOW;         // the current state of the output pin
int button1State;             // the current reading from the input pin
int lastButton1State = HIGH;   // the previous reading from the input pin
int ridebuttonState = LOW;
int button2State;
int lastbutton2State = HIGH;
long lastDebounceTime = 0;  
long debounceDelay = 50;  

void setup()

{
  lcd.init();                      // initialize the lcd   
  lcd.backlight();


 pinMode (lfupPin, OUTPUT);
 pinMode (lfdownPin, OUTPUT);
 pinMode (rfupPin, OUTPUT);
 pinMode (rfdownPin, OUTPUT);
 pinMode (lrupPin, OUTPUT);
 pinMode (lrdownPin, OUTPUT);
 pinMode (rrupPin, OUTPUT);
 pinMode (rrdownPin, OUTPUT);
 pinMode (upbuttonPin, INPUT);
 pinMode (ridebuttonPin, INPUT);

  lcd.home (); 

  lcd.setCursor (4,0);   
  lcd.print("RIDE HEIGHT");     //print at column 4, row 1
  lcd.setCursor (5,1);   
  lcd.print("1941 FORD");     //print at column 5, row 2
  lcd.setCursor (0,2);   
  lcd.print("LF:");     // print at column 0, row 3
  lcd.setCursor (14,2);
  lcd.print("RF:");     //print at column 14, row 3
  lcd.setCursor (0,3);   
  lcd.print("LR:");     //print at column 0, row 4
  lcd.setCursor (14,3);  
  lcd.print("RR:");     //print at column 14, row 4
}

 void loop()
 {
 

 
  lcd.setCursor (3,2);   
  lcd.print(analogRead(LFPot)); // Prints value on LFPot to LCD
  lcd.setCursor (17,2);    
  lcd.print(analogRead(RFPot)); // Prints value on RFPot to LCD
  lcd.setCursor (3,3);
  lcd.print(analogRead(LRPot)); // Prints value on LRPot to LCD
  lcd.setCursor (17,3);
  lcd.print(analogRead(RRPot)); // Prints value on RRPot to LCD

 }

Try doing this for each printed line:

lcd.setCursor (3,2);
lcd.print("    "); // 4 spaces, wipes old characters
lcd.setCursor (3,2); 
lcd.print(analogRead(LFPot)); // Prints value on LFPot to LCD

That worked!
No just need to figure out how to change my output to a %

The percentage calculation will depend on your hardware. If you have a UNO, the resolution of the analog to digital converter is 0 - 1023 (have a look here for other boards). Then the percentage will be

perCent = analogRead(LFPot) * 100 / 1023;

The division may be tricky if you're using integers, so the simplest would be

float perCent = analogRead(LFPot) * 100.0 / 1023.0;
lcd.print(perCent,0);

or change the 0 if you want more digits after the comma.