If you are converting 40cm to one inch and the conversion ratio is 2.54 : 1, you would place 40 in the numerator as the original ration has 2.54/1 as a fraction and the same will apply to 40cm.
** This applies if you are finding which number is in the numerator and not the answer to how much 40cm in inches is.