Skip to content

Commit 31069a7

Browse files
committed
docs(readme): update docs
1 parent 2d2965c commit 31069a7

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

README.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,26 @@ npm install --save eval-num-expr
88

99
## Usage
1010

11-
```
12-
import evalExpr from "eval-num-expr"
11+
```js
12+
import evalExpr from "eval-num-expr";
1313

14-
const value = evalExpr('100 + 3 * 55 + 73 - 73 * 18%')
14+
const value = evalExpr("100 + 3 * 55 + 73 - 73 * 18%");
1515
// value = 324.86
1616
```
17+
18+
You can use basic operations (e.g. +, -, \*, /, %, ^ etc.) in you expressions.
19+
20+
### Examples
21+
22+
- 175 + 175 \* 18% + 40 = 246.5
23+
- 10 + (100 - 100 \* 18%) \* 5 + 40 / 20 = 422
24+
25+
## Api
26+
27+
### evalExpr
28+
29+
This is the default and only from this package.
30+
31+
```js
32+
evalExpr(expressions: string, digitsAfterDecimal?: number = 2)
33+
```

0 commit comments

Comments
 (0)