Scaling inputs to a range?

Hi, i know this is more of a maths question and ive googled and found numours valid looking ways but they seem overkill so thought i would ask here.

I want to convert the analog input to a scale of my own, so the full range of the analog input would represent 0 to 30? (for example)

Thanks Andy

I want to convert the analog input to a scale of my own, so the full range of the analog input would represent 0 to 30?

int inVal = analogRead(somePin);
int outVal = map(inVal, 0, 1023, 0, 30);

I was just returning to edit this to say ive just found the map function.

Thanks again though.

Andy