Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": "smart-round",
"version": "3.0.0",
"version": "3.0.1",
"description": "Round big numbers with arbitrary precision",
"keywords": [
"big.js",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const parse = function ({
throw new Error("maxDecimals should be positive");
}
if (minDecimals > maxDecimals) {
throw new Error("minDecimals should be larger than maxDecimals");
throw new Error("minDecimals should not be larger than maxDecimals");
}
if (typeof input === "number" && (isNaN(input) || !isFinite(input))) {
throw new Error("input should be a valid number");
Expand Down
4 changes: 2 additions & 2 deletions test/src.index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,10 @@ describe("smartRound", function () {
expect(() => rounder("1")).toThrowError("maxDecimals should be positive");
});

it("should not allow minDecimals smaller than maxDecimals", function () {
it("should not allow maxDecimals smaller than minDecimals", function () {
const rounder = smartRound(1, 3, 2);
expect(() => rounder("1")).toThrowError(
"minDecimals should be larger than maxDecimals",
"minDecimals should not be larger than maxDecimals",
);
});

Expand Down