1.3.1 • Published 2 years ago
@reskit/math-expression v1.3.1
Install
Install @reskit/math-expression by pnpm
pnpm add @reskit/math-expressionFunctions
You should import method:
import { extractMathExpression, computeMathExpression } from "@reskit/math-expression";Extract Math Expression
Input
extractMathExpression("Calculate 1+3+4-5");Output
["1+3+4-5"]You can compute it by @reskit/shared
Input
import { calculate } from "@reskit/shared";
calculate("1+3+4-5");Output
3Compute Math Expression
computeMathExpression("Answer: 1+ 3+(4-5)*6/ 3");Output
Answer: 2Compute Decimal
Input
computeMathExpression("Answer: 65+28.6+35+71.4");Output
Answer: 200Multiple Math Expression
Input
computeMathExpression("Answer: A = 65+28.6+(1 + 35/7)+71.4; B = 1.1+1.2+1.3+1.4");Output
Answer: A = 200; B = 5Others
Welcome to create PR and make @reskit/math-expression better!