Convert a decimal inch value to an inch and fraction format. Not all that complicated. The amount before the decimal point is the full inch value and needs no conversion. The decimal part, the digits after the decimal point, are the ones converted into a fraction.
The denominator of the fraction is determined by the location of the last digit in the number.
Note; the denominator is always a one with as many 0's as there are digits behind the decimal point.
To get the fraction's numerator, multiply the decimal part of the number by the denominator to get a whole number. This whole number is the numerator of the fraction.
0.875
1000 is the denominator
0.875 * 1000 = 875
875 is the numerator of this fraction.0.875 = 875/1000 simplified to 7/8
12.3685
10000 is the denominator
0.3685 * 10000 = 3685
3685 is the numerator of this fraction.12.3685 = 12-3685/10000 simplified to 12-737/2000