Functions > Miscellaneous Functions > Example: Converting Feet-Inches-Fractions to Length
Example: Converting Feet-Inches-Fractions to Length
This example demonstrates the use of FIF as a function and as a scaling unit.
The FIF function argument, sFIF, must adhere to one of two formats:
A string of the form "n' m-p/q" where n, m, p, and q are positive integers. The first element of the string, n', represents the number of feet, and the second element, m-p/q, represents inches and fractions of inches.
At a minimum, the string must contain n', m, or p/q. No decimal fractions are allowed.
An error is displayed if n and m are specified and the apostrophe is missing from n.
If only n is specified and without the apostrophe, then it is interpreted as inches.
A comma-separated list of one to three positive real numbers representing feet, inches, and fractions of an inch.
At a minimum, the list must contain one number.
All numbers can contain decimal fractions.
Prerequisite
Set the Unit System to SI, and the Result Format to (Decimal).
Using FIF
1. Set sFIF to a string that adheres to the "n' m-p/q" format.
Click to copy this expression
2. Define variable L as the output of the FIF function.
Click to copy this expression
Click to copy this expression
The unit and magnitude of the returned length depends on the selected Unit System.
3. Using the length result, delete the current length unit m and then on the Math tab, in the Units group, click Units and insert the FIF unit from the Length category.
Click to copy this expression
The length 2.902 m is converted back to the original feet-inches-fractions string.
4. Evaluate the FIF function while specifying no value for the inches.
Click to copy this expression
Click to copy this expression
If one number is specified without the apostrophe, then it is interpreted as number of feet.
5. Evaluate the FIF function while specifying the number of inches, or a fraction of an inch, and no feet.
Click to copy this expression
Click to copy this expression
6. Evaluate the FIF function while specifying the number of inches, or a fraction of an inch, and no feet using a comma separated list.
Click to copy this expression
Click to copy this expression
In this case, a zero must be placed in each unspecified field to the left of the specified field.
7. Find the comma separated list that if passed to the FIF function returns 1 m.
a. Evaluate 1 m and change the result unit to ft.
Click to copy this expression
One meter equals 3 whole feet plus a fraction of a foot. Therefore, the first element of the list is 3.
The comma separated list now looks like 3, xx, x.x.
b. Evaluate the above fraction and change the result unit to in.
Click to copy this expression
The fraction of the foot equals 3 whole inches plus a fraction of an inch. Therefore, the second element of the list is also 3, and the third element is the fraction 0.37008.
The final comma separated list is now 3, 3, 0.37008.
c. Pass the comma separated list as argument to the FIF function.
Click to copy this expression
d. Evaluate 1 m and then change the unit to FIF.
Click to copy this expression
One meter equals 3 feet, 3 inches and 47/127 of an inch.
Was this helpful?