Closed (fixed)
Project:
Webform Calculator
Version:
7.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
8 Jun 2015 at 19:33 UTC
Updated:
31 Jan 2017 at 21:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Snehal Brahmbhatt commentedTry the patch webform_calculator-fixes_for_power_operator-2502619-1-D7.patch to resolve the issue you are facing.
Apply patch in
webform_calculator/webform_calculator.jsfile.Let me know incase of any concern/query regarding this.
Thanks,
Snehal Brahmbhatt | AddWeb Solution
https://www.drupal.org/user/3147795/track
Comment #2
Snehal Brahmbhatt commentedFollow this patch
Comment #3
Snehal Brahmbhatt commentedComment #4
Snehal Brahmbhatt commentedTry the patch power_operator_does-2502619-4.patch to resolve the issue you are facing.
Apply patch in webform_calculator/webform_calculator.js file.
Let me know incase of any concern/query regarding this.
Thanks,
Snehal Brahmbhatt | AddWeb Solution
https://www.drupal.org/user/3147795/track
Comment #5
Snehal Brahmbhatt commentedComment #6
Snehal Brahmbhatt commentedPlease test the patches provided in #2 & #4 for Version 7.x-2.x-dev
Comment #7
saurabh.dhariwal commentedComment #8
rafalenden commentedThanks for patch snehal.brahmbhatt.
I've tested it didn't work for me when using with formula
{a} ^ 2.Additionally we should provide a patch for PHP code.
Comment #9
rafalenden commentedSince power operator was removed changing category to feature request.
Comment #10
Snehal Brahmbhatt commentedHi Rafal,
PFA patch for PHP code per your request. Check once and let me know your thoughts.
Comment #11
Snehal Brahmbhatt commentedComment #12
Snehal Brahmbhatt commentedIgnore #10 and check the latest updated Patch: "support_for_power-2502619-12.patch". This contains combined code for Javascript and PHP.
Comment #13
MichaelWimpey commentedHi Snehal Brahmbhatt, Thanks for the work on this so far, this is definitely a useful feature, which seems to be working, but on form submission, is giving the following error:
Error message
Warning: Division by zero in eval() (line 1 of .../sites/all/modules/webform_calculator/webform_calculator.module(55) : eval()'d code).
Comment #14
colemanw commentedReading the patch in #12 it looks like this will limit expressions to either use a power or other operators. So currently
{a} + {b} / {c}works, but{a} + {b}^{c}will not.Comment #15
lcfi commentedComputed values with arent saved in the database. We are looking for a paid solution to that problem.
Lawrence
Comment #17
colemanw commentedFixed by incorporating 3rd-party math libraries. This module now supports a slew of math operators and functions, not just ^.