Decimal to Fraction
Tape-measure math: round a decimal inches value to the nearest 1/8, 1/16, 1/32, or 1/64, reduce the fraction to lowest terms, break it into feet-inches, and report the rounding error (first-principles arithmetic).
Formula and source
ticks = round(value * den); whole = floor(ticks/den); fraction = (ticks - whole*den)/den reduced by GCD; feet = floor(whole/12); error = rounded - exact.
Decimal-to-fraction tape-measure math - nearest 1/N rounding, GCD reduction, and feet-inch decomposition; first-principles arithmetic, public domain.
Audience
This tile is built for trades and the adjacent professions in the Cross-Trade Utilities group. The interactive calculator runs entirely in your browser. No account, no fee, no advertising, no tracking.
Related tools
Posture
Rough Logic answers the math question the working professional asks on the job. The site is a calm, fast, ad-free, account-free, ever-free reference. It does not interpret code. It does not replace the licensed professional. It does not store your inputs. The Authority Having Jurisdiction governs all installations and inspections.