Conditional calculations: Last digits from the calculations are cut off

  • Profile Image
    ngmsys
    Asked on June 20, 2017 at 05:39 AM

    We configured the fields with quite simple logic "If condition works then Field A * const".

    But each time when users filled in the form the calculations are wrong.

    Let's see last submission. The value of fields input53 and input54 are wrong.

    The formula is following: #input_53 = #input_41 * 7500 

    It should be 562500 but the returned value is 5625.

     

    When we fill in the form in the demo mode (from the form constructor) the calculations work. At least, sometimes.

    So, we upgrade our tariff to get more capabilities for our users but the problem with conditional logic blocks our plans.

     

    Thanks in advance.

  • Profile Image
    EltonCris
    Answered on June 20, 2017 at 07:02 AM

    Does it contain decimal point before the trailing zeros? 

    Example: 5625.00

    If it's a whole number 562500 then there probably is a problem with the calculation. 

    Have you tried enabling the "Show empty decimal places" option in the calculation settings? Try it and see if this helps.

    Here's how:

    1. Edit the calculation condition

    2. Click the ellipsis (three dots) to open the calculation settings then check "Show empty decimal places". After that set the decimal places to your preference.e.g 2.

    Visual guides:

    Please let us know if this helps or not so we can assist you further.

  • Profile Image
    ngmsys
    Answered on June 22, 2017 at 04:17 AM
    1. No, returned value doesn’t contain decimal point.

    2. It's not possible to save changes in the existing conditions. It's really doesn't work. I checked it in two browsers - safari and chrome.

  • Profile Image
    Nik_C
    Answered on June 22, 2017 at 06:48 AM

    I checked your form and I would say that the issue is in the type of conditions used since I caught an anomaly while I was testing it. And that would explain that your calculations worked sometimes and sometimes it didn't.

    Basically in this test checklist:

     

    And I set the conditions to check the second and third options and if they are checked to insert the value in text field, but the value will be inserted if the first option is selected as well, and I'm wondering if something similar is happening for you, so I will test this a bit more and I'll get back to you.

    Thank you!

  • Profile Image
    Nik_C
    Answered on June 22, 2017 at 03:22 PM

    Thank you for your patience, the problem is in how the Checklist widget is functioning, so in order to fix this is please check this option:

    That should fix conditional calculation issues.

    If that doesn't work for you please get back to us, but also, please check the below alternatives:

    http://widgets.jotform.com/widget/line_checkbox 

    http://widgets.jotform.com/widget/flat_checkbox 

    http://widgets.jotform.com/widget/minimal_checkbox 

    http://widgets.jotform.com/widget/square_checkbox 

    Or regular checkbox field:

    Please let us know how it goes.

    Thank you!

  • Profile Image
    ngmsys
    Answered on July 07, 2017 at 04:20 AM

    When I try to update the option "Hide unchecked option" but it is not saved.

    When I change this option in the widget setting and click the button "Update widget". When I open the setting it's saved.Great!

    After that I close the form constructor and visit it again. Open the widget settings and see that the new option value is not saved!

    I'v tried to do it in the different browsers - safari, chrome.

    The absolutely the same problem happens with conditions. I have to do the same action (update smthg) 5-10 times again and again. Sometimes new value is saved sometimes - not. I don't thinks that is a problem with cache.

    Thanks in advance.

  • Profile Image
    Charlie
    Answered on July 07, 2017 at 06:22 AM

    Please note that widgets are special fields and we cannot guarantee that they will work in the default Conditional Logic feature. This is because the widgets are often built inside a frame, there are improvements made but compatibility of it in a conditional logic is not assured. The Conditional Logic feature is best used in our default/basic form fields. Which my colleague showed in a screenshot:

     

    Also, what is this formula "The formula is following: #input_53 = #input_41 * 7500 "? What is #input_41? Is this a Checklist widget? Please note that that widget cannot hold a calculation value, so multiplying it to 7500 will not work as far as I know.

    If you want to assign calculation values on check boxes and do calculations, then you can use the default check boxes named "Multiple Choice" presented on the screenshot above, you can then follow the links below on how you can perform calculations:

    To assign calculation values on default drop down fields, radio button and check boxes, you can follow this guide: https://www.jotform.com/help/301-How-to-Assign-Calculation-Value 

    To perform calculations using those values, you can check these guides:

    https://www.jotform.com/help/259-How-to-Perform-Form-Calculation-Using-a-Widget 

    https://www.jotform.com/help/268-Conditional-Logic-Inserts-Text-Calculation-Into-A-Field 

     

    For the issue where the changes in the widget not being saved, I have opened a separate thread for it. Please refer to this link instead: https://www.jotform.com/answers/1193378. We will address that one accordingly.

    Thank you.

  • Profile Image
    ngmsys
    Answered on July 07, 2017 at 06:36 AM

    1. I can't save options. F.E. "Show empty decimal places"  It's not about external widgets, It's about core functionality of your service.

    2.  I don't use widget for calculations. All calculations are saved in the basic fields. Widgets options are used in conditions: If Option A than Formula 1, If Option B that Formula B. Just review conditions to understand how it works. 

  • Profile Image
    Nik_C
    Answered on July 07, 2017 at 11:40 AM

    I will check this issue a bit more and I will get back to you. 

    Thank you!

  • Profile Image
    Nik_C
    Answered on July 07, 2017 at 03:03 PM

    Thank you for your patience.

    1. I can't save options. F.E. "Show empty decimal places"  It's not about external widgets, It's about core functionality of your service.

    I was able to replicate this issue. The option is not saving (at least is not showing that it is saved) but the empty decimals are showing:

    I will forward that issue in separate thread here: https://www.jotform.com/answers/1193846 

    Regarding the original problem, could you please let us know how this condition work:

    What should be multiplied with 7300? Since I'm unable to determine what is the Click to edit field, most probably the name was changed later.

    So we can test further.

    Thank you very much.

  • Profile Image
    ngmsys
    Answered on July 09, 2017 at 04:37 PM

    There is a pretty simple formula.

    The field #input_41 (Apartment square) multiply on price per square meter (7300). The price per sq meter depends on chosen options.

    The goal of formula is to calculate a preliminary price of renovation.

    For example, apartment square = 40m2, the price per sq meter = 7300 (based on chosen options). The final result that we've got = 3285 instead of 328 500. Two zeros are got lost.

    Before that we tried to use the complex formulas but cancel it. Internal logic is not clear. Even linear formulas doesn't work. 

     

     

     

  • Profile Image
    Mike
    Answered on July 09, 2017 at 05:41 PM

    For example, apartment square = 40m2, the price per sq meter = 7300 (based on chosen options). The final result that we've got = 3285 instead of 328 500. Two zeros are got lost.

    I am not currently able to reproduce that issue on a cloned version of your form.

    Could you please create a simple form where the issue can be reproduced? We will be able to escalate a bug report to our developers once the issue is clear.

  • Profile Image
    ngmsys
    Answered on July 10, 2017 at 09:26 AM

    The problem is that when we fill in form in the preview mode on the jotform site the result is correct. But when the client fills in the form the result is as described before. That could be the reason why you can't find the bag.

    Just see two last submissions. The first one is filled by client, the result is incorrect. The last submission is made by us. The calculation is correct. I can send all submission that we have and you can analyze it.

    I'd highlight that errors happen when clients fill it in.

  • Profile Image
    Nik_C
    Answered on July 10, 2017 at 11:45 AM

    The problem is that when we fill in form in the preview mode on the jotform site the result is correct. But when the client fills in the form the result is as described before. 

    I'm sorry if I overlooked something, but what is different when your clients fill in the form?

    Are they using some different URL so we can test?

    We'll wait for your response.

    Thank you!

  • Profile Image
    ngmsys
    Answered on July 10, 2017 at 01:24 PM

    1. It's also a big question for me. The main difficulty in terms of testing is difficult to repeat the error and identify the core cause.

    Just see the submissions. There are wrong values in the calculated fields ( #input_53, #input_54).

     

    2. We integrate the form on the site using the following code:

     <script src="https://form.jotformeu.com/static/feedback2.js" type="text/javascript"> var JFL_71133051103335 = new JotformFeedback({ formId: '71133051103335', base: 'https://form.jotformeu.com/', windowTitle: 'Расчет сметы', background: '#ff8256', fontColor: '#FFFFFF', type: 'false', height: 800, width: 800, openOnLoad: true }); </script>

  • Profile Image
    Nik_C
    Answered on July 10, 2017 at 02:27 PM

    Ok, that might be the problem, we will check the submission, but what is the website URL where the form is embedded?

    Thank you for getting back to us.

  • Profile Image
    ngmsys
    Answered on July 11, 2017 at 09:59 AM

    https://stroyalty.ru/express-smeta

  • Profile Image
    Nik_C
    Answered on July 11, 2017 at 11:23 AM

    Thank you for letting us know, I will test this further and get back to you.

    Thank you!

  • Profile Image
    Nik_C
    Answered on July 11, 2017 at 03:37 PM

    Thank you for your patience.

    I was able to completely replicate this issue, the result is always cut off. But the issue is related to your form, I wasn't able to replicate it when I cloned the form, which you can check as well:

    https://form.jotformpro.com/71916105759967

    I left those two fields visible for ease of testing.

    I will forward this issue to our backend team for further checking. We will inform you once we have more information through this thread.

    Thank you.

  • Profile Image
    Helen
    Answered on August 03, 2017 at 08:01 AM

    Hello @ngmsys,

    Thank you for contacting us and sorry for the late response.

    I have checked your form and update/calculate conditions. Also, I could see that you have used "Labelless widget" for collecting your data and used on your conditions. 

    However, the Labelless widget returns the data like 'LabelName : Value'. I have created a new form and added a widget, then submitted the form for showing you. Here is a submission of the form:

    So, when you want to use this widget with calculations, it tries to multiply with this string and the result is shown wrong because of this.

    I can suggest you use another type of field for fixing your issue. You can use number, text etc. Then, your conditions will work properly.

    I hope it helps to you and it solved your issue.

    If you have any questions or issue, please do not hesitate to contact us.

    Thank you so much,