Closed Necmttn closed 2 years ago
Those are boolean expressions, which do not evaluate in a number result. You can however register your own functions to achieve this, e.g. like this:
const fObj = new Formula('lessThan(x+y, z)'); // representing x + y < z
fObj.lessThan = (a, b) => a < b ? 1 : 0;
let result = fObj.evaluate({x: 1, y: 2, z: 4}); // => 1
Docu Pointer: https://fparse.alexi.ch/#using-user-defined-functions
gotcha, thank you
I would like to use fparse to create binary cases to execute like
is there a way to extend this functionality?