If you’re looking for ‘easy’ the easiest way would to create a compile time array that has your fraction values.
Do a look up (using your decimal value) to reference your corresponding ‘fraction’ value, plug it in and away you go.
I only recommend this approach if you have a limited number / range of fractions. . . I’d say down to 10ths.
REGISTER or login: