Skip to content

Commit

Permalink
fix: remove unnecessary decimal part from format of bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
abap34 committed Apr 13, 2024
1 parent 27da644 commit 7e17b50
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/common/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ const formatBytes = (bytes) => {
}

if (bytes === 0) {
return "0.0 B";
return "0 B";
}

const sizes = ["B", "KB", "MB", "GB", "TB", "PB", "EB"];
Expand Down
2 changes: 1 addition & 1 deletion tests/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ describe("Test utils.js", () => {
});

it("formatBytes: should return expected values", () => {
expect(formatBytes(0)).toBe("0.0 B");
expect(formatBytes(0)).toBe("0 B");
expect(formatBytes(100)).toBe("100.0 B");
expect(formatBytes(1024)).toBe("1.0 KB");
expect(formatBytes(1024 * 1024)).toBe("1.0 MB");
Expand Down

0 comments on commit 7e17b50

Please sign in to comment.