Skip to main content
Known Participant
March 21, 2018
Answered

Is there a way to make a fillable PDF in fractions

  • March 21, 2018
  • 1 reply
  • 2672 views

I'm currently working on a fillable PDF that calculate measurement in inches. I was wondering if there is a way to input and calculate the measures in fractions? The file will be used by people in the workshop and they will prefer to have to measure 5 9/16" instead of 5.5625".

Thanks a lot

This topic has been closed for replies.
Correct answer Thom Parker

I wish to automatically calculate the length of a tube. Currently it makes a calculation like : length+dia=total. But I want to be able to input the dimensions and have the total in the fields in fractions and not in decimal.


Converting a decimal value into a fraction is quite problematic.  Here are some web sites that explain it:

Convert Decimals to Fractions

To do this directly you need to guarantee that the decimal value is rational. Otherwise you can only get close, not right on.

Here is a website with a calculator that does it. I don't know for sure, but I suspect the conversion is done client side. If it is you can copy the JS code for your form.

Decimal to Fraction Calculator

Using fractions in a calculation is a different problem. Here's an online calculator. Again, if the code is client side you'll be able to copy it and use it on your form.

Online Fraction Calculators | Help With Fractions

1 reply

try67
Community Expert
Community Expert
March 21, 2018

It's possible, but you will need to write your own custom calculation scripts to be able to handle such values. You won't be able to use any of the built-in Calculation or Format options.

Known Participant
March 21, 2018

That's what I thought. Any Idea what kind of script I will need. I'm a total noob in javascript.

try67
Community Expert
Community Expert
March 21, 2018

What kind of calculations do you want to perform?