I am trying to compute area given width and length. My problem lies with any fractions. i have fields WIDTH_INCH, LENGTH_INCH, WIDTH_FRACTION, LENGTH-FRACTION (1/32, 1/16, 1/8, ETC), LENGTH_FRACTION (1/32, 1/16, 1/8, ETC), and AREA. The formula for AREA = (WIDTH_INCH + WIDTH_FRACTION) * (LENGTH_INCH + LENGTH-FRACTION)
I am having a problem with converting the fraction to a decimal. I have tried using a field for conversion WIDTH_FRACTION_CONVERSION with an IF Statement (i.e. If WIDTH_FRACTION = 1/4;0.25) This is not working! What am I overlooking?
Hi Patrick,
Since you also emailed me your question and I responded, I’ll just respond here with my same email reply.
The proper syntax for the IF function in the Calculation field to be used on a Text field is the IFEQUAL() function:
IFEQUAL(WIDTH_FRACTION; “1/4”; 0.25; 0)
1/4 is not storable as a Number field value because the / is not a number value. So I’m going to assume your WIDTH_FRACTION field is a Text field.
The IF() function works on Number fields. The IFEQUAL() function works on Text fields.
Hi Patrick,
I’ve been using a helper script for a year or two so I can use fractions in my woodworking forms. Your post finally motivated me to bundle everything together in an example form and document how to use it.
Here’s the link: https://lab.danielleu.com/tapformspro/tips-tricks/index.html?p=Using-fractions
Hope this helps!
Cheers, Daniel
---
See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricks