I am working with data for the width and height of books. The data is in decimal form, such as 7.563, which I need to display as a fraction: 7 9/16 in.
The denominator can vary and the decimal value isn't always rounded the same. Here is some sample data and the converted values:
6.438 6 7/16 in.
4.625 4 5/8 in.
7.62 7 5/8 in.
11.0 11 in.
5.68 5 11/16 in.
8.688 8 11/16 in.
4.25 4 1/4 in.
I need the denominators to be integers commonly used for inches. For example, .18 would convert to 3/16 rather than something like 9/50 as shown in this answer.
Is there a formula I can use to do this conversion?