xsanisty / calx.js

jQuery Calx - a jQuery plugin for creating formula-based calculation form
http://www.xsanisty.com/project/calx2
MIT License
198 stars 72 forks source link

IF Greater than error #62

Closed aspnetlearning closed 4 years ago

aspnetlearning commented 4 years ago

Hi, First all, thanks for this project. So, is this project still supported?

My question is usin IF greater than result #Error but the reverse process is running so A1<B1 is working <input class="form-control input-sm" data-formula="IF(A1>B1;'OK','Problem')" id="F1" data-format="0,0[.]00" data-cell="F1" disabled>

ikhsan017 commented 4 years ago

Hi @aspnetlearning,

You are welcome! :)

It is kindof supported, I am in the middle of rewriting it to be more universal than just jQuery plugin, so new feature will not be added to current version.

There is known bug IIRC which involve < and > operator, where it require space before and after the operator A1 > B1 instead of A1>B1, I forgot which one, but one of those should works.

aspnetlearning commented 4 years ago

Hi, Thanks for answering. Yes it's require space and its working or with $ symbol. data-formula="IF(A1 > B1;'OK','Problem')" data-formula="IF($A1>$B1;'OK','Problem')"

jeanie77 commented 1 year ago

Hi @ikhsan017, I've found this issue which exactly matches a bug that was reported to me after upgrading to calx 2.2.8 from 2.2.6:

IF(C6>0,B:B/C6,0)                 // #ERROR!
IF(C6> 0,B:B/C6,0)                // ..ok..

Since this formula is being inserted by the user and then saved to database, I'd rather not force him to enter unwanted spaces. Also, there are many formulas on each table that must be calculated, so it would be dangerous (and probably expensive!) to parse all of them to fix spaces on the fly.

Have you found maybe, over the years, a fix that solves the problem? Or could you please suggest me a workaround to let the user enter the spaces he wants, without having errors during calculation?