CalderaWP / Caldera-Forms

Drag and drop, responsive WordPress form builder.
https://CalderaForms.com
GNU General Public License v2.0
187 stars 166 forks source link

UI Option To Set Rounding On Calculation Fields #1312

Open paaljoachim opened 7 years ago

paaljoachim commented 7 years ago

I am transfering a calculator plugin to instead use Caldera Forms.

Slider - The first slider has a step by step in how much someone wants to make. Calculation field - amount of products that need to be sold.

Slider - Amount of people involved in selling the products. Calculation field - How many products each person needs to sell.

Example in Norwegian Kr. 1600kr 20 products

1 person involved. 1 person needs to sell 20 products.

3 persons involved. These 3 need to sell 6.6666666667 products. I need CF to round off to 7. Meaning we need a rounding option in the calculation field.

screen shot 2017-02-27 at 17 51 32

paaljoachim commented 7 years ago

I am trying to find ways to use a math formula for the time being to round to nearest whole number. But it seems this might be too complicated for Caldera Forms.

https://se.mathworks.com/help/matlab/ref/round.html https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Math/round

YES!! I used this resource: https://support.google.com/docs/answer/3093440?hl=en

Here is a formula that works: round(fld_6816021/fld_5418981)

round(calculations here)

Makes any decimal point go away and the number is rounded to closest whole number.

paaljoachim commented 6 years ago

I am adding in a few related issues:

https://github.com/CalderaWP/Caldera-Forms/issues/1016 https://github.com/CalderaWP/Caldera-Forms/issues/428

https://github.com/CalderaWP/Caldera-Forms/issues/1949

Variables: https://github.com/CalderaWP/Caldera-Forms/issues/1888

https://github.com/CalderaWP/Caldera-Forms/issues/146

It would be great to deal with the above issues. Close/fix/etc.