Skip to content

Commit c040d2b

Browse files
committed
docs: update README.md
1 parent a8b71a4 commit c040d2b

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

packages/number-precision/README.md

+13-3
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,20 @@ yarn add @pansy/number-precision
1515

1616
## 🔨 使用
1717

18-
```
18+
```ts
1919
import NumberPrecision from '@pansy/number-precision';
2020

21-
const np = NumberPrecision();
21+
const np = new NumberPrecision();
22+
23+
// 加法
24+
np.plus(0.1, 0.2); // 0.3
25+
26+
// 乘法
27+
np.times(0.1, 10); // 1
28+
29+
// 减法
30+
np.minus(0.2, 0.1); // 0.1
2231

23-
np.add(0.1 + 0.2); // 0.3
32+
// 除法
33+
np.divide(0.2, 0.1); // 2
2434
```

0 commit comments

Comments
 (0)