my-formula-calculator
v1.1.2
Published
A tool for parsing and calculating formula strings
Downloads
17
Maintainers
Readme
My Formula Calculator
A Node.js module for parsing and evaluating arithmetic formula strings.
Installation
You can install this package via npm:
npm install my-formula-calculator
Usage
const calculateFormula = require('my-formula-calculator');
const input = {
formula: '(x + y) * z',
data: {
x: 0.1,
y: 0.2,
z: 1
}
};
const result = calculateFormula(input.formula, input.data);
console.log('Result:', result); // Output should be 0.3