Skip to content

Commit

Permalink
Version update new version 2.1.0 (#136)
Browse files Browse the repository at this point in the history
* Updated readme

* 2.0.9

* 2.1.0
  • Loading branch information
royNiladri authored Aug 10, 2024
1 parent efbe456 commit 71c44d2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,14 @@ var n2 = new bigDecimal('0.00130');
var product = n1.multiply(n2); // product = new bigDecimal('-0.000169')
```

### divide(dividend, divisor, precision)
Divide two numbers. Pass arguments as `string` if calling on bigDecimal or pass an instance of bigDecimal if calling on object. `precision` is an optional parameter with default value of 8.
### divide(dividend, divisor, precision, roundingMode)
Divide two numbers. Pass arguments as `string` if calling on bigDecimal or pass an instance of bigDecimal if calling on object. `precision` is an optional parameter with default value of 8. `roundingMode` has a default value of `HALF_EVEN`.
```javascript
var quotient = bigDecimal.divide('45', '4', 2); // quotient = '11.25'
```
```javascript
var quotient = bigDecimal.divide('45', '4', 0, RoundingModes.CEILING); // quotient = '12'
```
Alternately, use the instance property. It returns the result as new `bigDecimal`.
```javascript
var n1 = new bigDecimal('45');
Expand Down
2 changes: 1 addition & 1 deletion dist/esm/big-decimal.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "js-big-decimal",
"version": "2.0.8",
"version": "2.1.0",
"description": "Work with large numbers on the client side. Round them off to any required precision.",
"main": "dist/node/js-big-decimal",
"types": "dist/node/big-decimal",
Expand Down
2 changes: 1 addition & 1 deletion src/divide.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,6 @@ describe("divide", function () {
expect(divide(27.999972, 128, 10)).toBe("0.2187497812");
})
it("division of 27.999972 by 128 with precision of 10 and rounded by HALF_UP mode should return 0.2187497813", function() {
expect(divide(27.999972, 128, 10, RoundingModes['HALF_UP'])).toBe("0.2187497813");
expect(divide(27.999972, 128, 10, RoundingModes.HALF_UP)).toBe("0.2187497813");
})
});

0 comments on commit 71c44d2

Please sign in to comment.