fraction calculations used in a dropdown

By: Frank Galvin | Asked: 12/20/2022
ForumsCategory: How-tofraction calculations used in a dropdown
Frank Galvin asked 1 year ago
I have a form that has a dropdown field where you can select a fraction( 1/4,1/2,3/4 etc) this is used in a calculation to determine the amount  remaining a water tank. The math will only work if I use , for example, ( 1/8 as 0.125, 1/4 as 0.25 etc..)  . The question is how do I have the dropdown show (1/4) but have the result use 0.25) in the calculation? from:   tank size  1000 select dropdown ( 1/8 )  don't want them to see 0.125 result 128     Thanks for your help !!   Frank
2 Answers
Victor Font answered 1 year ago

You can use separate values in a dropdown. The label can be 1/8 and the value .125. Use the value in your calculations. The customer sees the label.

Frank Galvin replied 1 year ago

Thanks for responding so quickly.. The dropdown has five different options of unique fractions. If I use the label it would only have one fraction. , right.. So then it wouldn't make sense to have a dropdown . right?

Victor Font replied 1 year ago

You check the use separate values checkbox on the dropdown and enter the values as decimals. Each option is its own label/value combination. If you have 5 fractions, then 5 x label/value == 5 x fraction/decimal.

Frank Galvin answered 1 year ago

Add Bulk Edit option ....see attached


Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community