0-5V linear sensors Display in percentage

I have 2 sensors which are both 0-5V linear sensors.

I would like to display one of the readings as a percentage (0V=0% to 5V=100%)

The other i would like to display as a temperature. (0V= -40 to 5V= 125 °C)

Would like to display them on a LCD 16x2 display.

I am savvy with the wire up and connections however the programming behind this i cannot get my head around.

Any help/guidance would be appreciated.

however the programming behind this i cannot get my head around.

What have you tried? What happened?

If you are looking for someone to write the code for you, this isn't the place. Gigs and Collaboration is. Expect this to be a paid gig.

Have you managed to display anything on the LCD ?
Post any code that you have tried, whether it worked or not.

Leave the display out of it to start, and display the answers in the serial monitor for simplicity. Make sure your sums work, then you only have to deal with one type of problem at a time.

For the first part, take your reading which is between 0 and 1023, and divide by 1023 and times by 100; effectively divide by 10.23. That would be the percentage.

For the second one, have a look at the map() command.

I certainly dont want this done for me as i wont learn that way.

JimboZA:
For the second one, have a look at the map() command.

void loop()
{
int val = analogRead(0);
val = map(val, 0, 5, -40, 125);
}

From what i understand of the map function AnalogRead(0) is input A0 (sensor input)

and im telling it that the values it should expect is between 0 and 5V but i would like it displayed as -40 to 125

Will the LCD stage be where i assign what units it is in? Im used to using siemens plcs but this is very different in terms of language.

could i not do another map function for the percentage but 0-100 as the new low high?

and im telling it that the values it should expect is between 0 and 5V but i would like it displayed as -40 to 125

Did you mean "the values it should expect is between 0 and 1023 " ?

I'm not sure what you mean by assign its units, but yep at display time is where I'd display the units, just stick a "%" or whatever on the end.

Yep I'm sure you could use map to scale it from 0-100 as a %.

AWOL:
Did you mean "the values it should expect is between 0 and 1023 " ?

Yes

JimboZA:
I'm not sure what you mean by assign its units, but yep at display time is where I'd display the units, just stick a "%" or whatever on the end.

Yep I'm sure you could use map to scale it from 0-100 as a %.

exactly how you explained it, if i have the sensor input range changed to the numbers i want i can then add the units to the end of the string on the display.

So like you said % on the end of the 0-100 scaled input.

Ok i need to write this and check out how it reads.