index.js
function(decimal, units, precision) {
		if(typeof decimal !== "number" || isNaN(decimal) || !isFinite(decimal))
			return false;
		if(["inches", "feet"].indexOf(units) < 0)
			return false;
		if(["1/2", "1/4", "1/8", "1/16", "1/32", "1/64", "1/128", "1/256"].indexOf(precision) < 0)
			return false;
		
		var architectural = "";
		
		var precision = parseFloat(precision.replace("1/", ""));
		
		if(units !== "inches")
			decimal = decimal * 12;
		
		if(decimal < 0) {
			decimal = Math.abs(decimal);
			architectural += "-";
		}
		
		var feet = Math.floor(decimal / 12);
		architectural += feet + "' ";
		
		var inches = Math.floor(decimal - (feet * 12));
		architectural += inches + "\"";
		
		var fraction = Math.floor((decimal - (feet * 12) - inches) * precision);
		if(fraction > 0)
			architectural = architectural.replace("\"", " " + reduceFraction(fraction, precision) + "\"");
		
		return architectural;
	}
function(decimal, units, precision) {
		if(typeof decimal !== "number" || isNaN(decimal) || !isFinite(decimal))
			return false;
		if(["inches", "feet"].indexOf(units) < 0)
			return false;
		if(["1/2", "1/4", "1/8", "1/16", "1/32", "1/64", "1/128", "1/256"].indexOf(precision) < 0)
			return false;
		
		var architectural = "";
		
		var precision = parseFloat(precision.replace("1/", ""));
		
		if(units !== "inches")
			decimal = decimal * 12;
		
		if(decimal < 0) {
			decimal = Math.abs(decimal);
			architectural += "-";
		}
		
		var feet = Math.floor(decimal / 12);
		architectural += feet + "' ";
		
		var inches = Math.floor(decimal - (feet * 12));
		architectural += inches + "\"";
		
		var fraction = Math.floor((decimal - (feet * 12) - inches) * precision);
		if(fraction > 0)
			architectural = architectural.replace("\"", " " + reduceFraction(fraction, precision) + "\"");
		
		return architectural;
	}
function ( decimal , units , precision ) { if ( typeof decimal !== "number" || isNaN ( decimal ) || ! isFinite ( decimal ) ) return false ; if ( [ "inches" , "feet" ] . indexOf ( units ) < 0 ) return false ; if ( [ "1/2" , "1/4" , "1/8" , "1/16" , "1/32" , "1/64" , "1/128" , "1/256" ] . indexOf ( precision ) < 0 ) return false ; var architectural = "" ; var precision = parseFloat ( precision . replace ( "1/" , "" ) ) ; if ( units !== "inches" ) decimal = decimal * 12 ; if ( decimal < 0 ) { decimal = Math . abs ( decimal ) ; architectural += "-" ; } var feet = Math . floor ( decimal / 12 ) ; architectural += feet + "' " ; var inches = Math . floor ( decimal - ( feet * 12 ) ) ; architectural += inches + "\"" ; var fraction = Math . floor ( ( decimal - ( feet * 12 ) - inches ) * precision ) ; if ( fraction > 0 ) architectural = architectural . replace ( "\"" , " " + reduceFraction ( fraction , precision ) + "\"" ) ; return architectural ; }
Convert decimal measurement to architectural notation.

@param {Number} decimal
@param {String} units
@param {String} precision
@return {String}
Convert decimal measurement to architectural notation .