fparse
fparse copied to clipboard
A JavaScript Formula Parser
allow string params to user formula for example: ``` var fObj = new Formula('if(eq(prop(1),prop(2)), "yes", "no")'); fObj.if=function(a,b,c) {...} fObj.eq=function(a,b) {...} fObj.prop=function(a) {...} ```
It would be useful to be able to have spaces in variable to aid readability. ## Example ``` const squareMyVariable = new Formula('[My Variable]^2'); fObj.evaluate({"My Variable": 3}); // Throws: Uncaught...
Can you make it so that when a formula is loaded, the parser doesn't apply scientific notation to large numbers? Or how can I achieve this in a fork? for...
It would be useful to allow passing object values into formula to process inside custom functions. Example: ``` const fObj = new Formula() fObj.distance = (point1, point2) => Math.sqrt(Math.pow(point1.x -...
can not process value like 1.38e-20 throw new Error(`Cannot evaluate ${r}, property not found (from path ${e})`); ^ Error: Cannot evaluate e, property not found (from path e)