Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

underway2014/eval-expression

Repository files navigation

eval-math-expression

Evaluate math expressions from String, Currently, only addition, subtraction, multiplication, and division are supported

Install

npm i eval-math-expression

Use

ES module:

import evalExpression from 'eval-math-expression'
evalExpression('(2+3/(3-1))*1.123') // result: 3.9305

CommonJS:

const evalExpression = require('eval-math-expression').default
evalExpression('(2+3/(3-1))*1.123') // result: 3.9305

Build

npm run build

Test

npm run test

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /