Display Potentiometer value as percentage

Hi, I've spent weeks trying to get the answer for this, and now that I have, I want to share the information for all those who will struggle in the future :smiley:

int potentiometerValue = analogRead(potentiometerPin);
int percent = map(potentiometerValue , 0, 1023, 0, 100);
Serial.println(percent);

Here's where I got the solution:
https://www.browncountylibrary.org/wp-content/uploads/2018/03/arduino_potentiometer.pdf