Formula Parser

View project on Github Download zip

Latest version

Formula Parsing

Formula Unparsing

Validation

bower

If you use bower.

bower install pg-formula-parser

npm

If you use npm.

npm install pg-formula-parser

Example


var formulaObject = null;

// Formula Parsing
var parsing = formulaObject = new FormulaParser('{expression}');

// Formula Unparsing
var unparsing = new FormulaParser(formulaObject.data);

// Formula Validation
var formula = new FormulaParser('{Some invalid expression}');
var isValid = formula.status === true;

// true = Validated, false = Syntax Error.
console.log(isValid);