Converting decimal number to carpenter's fractions

new topic     » topic index » view thread      » older message » newer message

Does anyone have, or can recommend a routine to convert decimals to carpenters inch fractions: 32nds, 16ths, 8ths, 4ths, halfs? I have a list of equivalents so I guess If there is no exact match, I would need to compare up the list until a higher value is reached and then subtract my search value from the larger value and subtract the previous lower value from the decimal value I am seeking to convert and then select the value which has the lowest difference.

sequence decimal_fractions { 
{.03125, 1, 32}, 
{.06250, 1, 16}, 
{.09375, 3, 32}, 
 ..... 
{.96875, 31, 32} 
 
 
 
x = 0.07356   
0.09375 - 0.07356 = 0.02019 
0.07356 - 0.06250 = 0.01106 x = {1,16}  or 1/16th inch 

Seems like there must be an easier way, though.

Any suggestions would be appreciated.

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu