how to convert decimal to fraction

I am using fractions of inch in woodworking project and the formula option gives me decimal numbers

I don’t know the answer to your question, but I expect that part of the solution would involve telling Calc that you want calculations done to the nearest eigtth of an inch, or sixteenth, or thirty-second, or sixty-fourth. Perhaps not so easy. In the meantime, you could construct a chart like the following to help :
1/32 0.03125

1/16 0.0625

3/32 0.09375

1/8 0.125

5/32 0.15625

3/16 0.1875

7/32 0.21875

1/4 0.25

9/32 0.28125

5/16 0.3125

11/32 0.34375

3/8 0.375

13/32 0.40625

7/16 0.4375

15/32 0.46875

1/2 0.5

and use it to “convert” the Calc decimal results back into convenient fractions for your own use. (Soirry, I stopped at half an inch.)

Turn everything to millimeters, the problems are over.

Perhaps the Questionner’s tools are all calibrated in inches (ruler, square, calipers, drill bits, mitre box, etc). Perhaps he is repairing or refurbishing cabinetry that was made in inches.

This means OP’s problem is an integer one. He’s working only with multiples of 1/32" or 1/64". He could transform his spreadsheet to use only whole numbers. The the sheet structure would be: an entry area to transform input usual units, like 5/32 into an integer number, the computation area and a display area where the result is converted back into common units.

What kind of input?
What’s “the formula”?
What kind of fractions (accepted denominators, mixed or not) would you like to get displayed?

As long as your results actually are numbers (instead of text looking like numbers) this is a matter of formatting.

Format the cells with a Fraction number format. Under Format → Cells… (or Ctrl+1), tab Numbers choose Category Fraction and from Format pick a suiting one like # ?/4 or # ?/8

2 Likes