mark_tools
v1.0.2
Published
实现JSON格式的公式整数四则混合运算(含括号)公式的解析执行【Calculate formulations in JSON formats】
Downloads
5
Maintainers
Readme
Intro
This is a package that can be used to calculate formulations in the following form(sth. like JSON):
- formula in String format
- data in the JSON format.
Usage
To use this package, follow the following steps:
install the package using npm.
npm install mark_tools
import the package
const evaluateFormula = require("mark_tools");
use the evaluateFormula function to calculate the result.
const evaluateFormula = require("mark_tools"); const input = { formula: '(x+y)*z', data: { x: 0.1, y: 0.2, z: 1 } }; const result = evaluateFormula(input); console.log(result)
And after this example, you will be able to see the result 0.3 logged in the console.