is there a way to convert a fractional number to decimal in order to use it in a calculation?

example:

use inputs…

field a:10 1/4

field b: 10

field a gets converted to 10.250 to be used in a calculation

thanks in advance

is there a way to convert a fractional number to decimal in order to use it in a calculation?

example:

use inputs…

field a:10 1/4

field b: 10

field a gets converted to 10.250 to be used in a calculation

thanks in advance

Does the number need to be converted on the page, to be used in calculations on the same page?

Are there an unlimited number of possibilities for fractions, or do you have a finite list where you could offer choices of:

- 1/4
- 1/2
- 3/4

or

- 1/8
- 1/4
- 3/8
- 1/2
- 5/8
- 3/4
- 7/8

etc.

Or, can you tell your visitors to enter the numbers in decimal format, to make the calculations possible without any additional work?

Hi Chris

thanks for responding!

Yes the number will be converted and used in calculations on the same page.

unlimited on the fractions…

posting the decimal format would not be a option at this point

I don’t believe there is a useful function in Gravity Forms for that. To do it live on the page for calculations in the same page will require some custom JavaScript or jQuery. I checked our knowledgebase and did not find anything. I will leave this open in case anyone has a suggestion on how to tackle this.

© 2008 - 2021. Gravity Forms is a project by Rocketgenius Inc.