Of course, there are infinitely many ways to do this. For the simplest way, where the conversion function is linear, you need to know the range of x. For example, if x ranges over [0, 45], then x = 45 is mapped to 25 * 45 / 45 = 25. but If x ranges over [0, 10000], then x = 45 is mapped to 25 * 45 / 10000.