Hereβs a new script that converts decimal feet to a fraction:
The precision input and a few other shortcuts allow the script to run quickly.
0" and dash symbols are controllable as well.
The design script is below:
//Convert Decimal Feet to Imperial Fraction
feet = Math.Floor(feetDec);
inch = Math.Floor(inchDec);
feetDec = Math.Round(numberprec12,0)/(prec12);
inchDec = Math.Round((feetDec-feet)12,8);
fracDec = inchDec-inch;
depthBool = prec==[1,2,4,8,16,32,64,128,256];
index = List.IndexOf(depthBool, true);
power = Math.Pow(2, (0β¦#index+1β¦1));
root = List.Transpose((fracDecprec)/power@L1<1>);
n = List.MinimumItem(Math.Round(root)==root? root: root+10000);
ds = β/β+List.Reverse(power)+"";
dInd = List.FirstIndexOf(root@L2<1>, n@L1<1>);
d = List.GetItemAtIndex(ds, dInd);
fracStr = String.StartsWith(n+d, β0β, false)? ββ: " β+n+d;
frac = String.Replace(fracStr, β.000000β, ββ);
end0 = feet+ββ"+"-"+inch+frac+""";
endD = String.Replace(end0, β-0"β, show0? β-0"β: ββ);
endFT = String.Replace(endD, β-β, dash);
endIN = (feet12)+inch+frac+""";
Enjoy!