Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Memory DIsplay (Closes #706) #728

Closed
wants to merge 3 commits into from
Closed
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
11 changes: 11 additions & 0 deletions Update.json
Original file line number Diff line number Diff line change
Expand Up @@ -2521,6 +2521,17 @@
}
],
"Notes": "No release notes were provided for this release."
},
"1.2.62": {
"UpdateDate": 1725100423891,
"Prerelease": true,
"UpdateContents": [
{
"PR": 728,
"Description": "Fix Memory DIsplay (Closes #706)"
}
],
"Notes": "No release notes were provided for this release."
}
}
}
12 changes: 7 additions & 5 deletions XMOJ.user.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name XMOJ
// @version 1.2.61
// @version 1.2.62
// @description XMOJ增强脚本
// @author @XMOJ-Script-dev, @langningchen and the community
// @namespace https://github/langningchen
Expand Down Expand Up @@ -322,13 +322,15 @@ let SizeToStringSize = (Memory) => {
try {
if (UtilityEnabled("AddUnits")) {
if (Memory < 1024) {
return Memory + "KB";
return Memory + "B";
} else if (Memory < 1024 * 1024) {
return (Memory / 1024).toFixed(2) + "MB";
return (Memory / 1024).toFixed(2) + "KB";
} else if (Memory < 1024 * 1024 * 1024) {
return (Memory / 1024 / 1024).toFixed(2) + "GB";
return (Memory / 1024 / 1024).toFixed(2) + "MB";
} else if (Memory < 1024 * 1024 * 1024) {
return (Memory / 1024 / 1024 / 1024).toFixed(2) + "GB";
} else {
return (Memory / 1024 / 1024 / 1024).toFixed(2) + "TB";
return (Memory / 1024 / 1024 / 1024 / 1024).toFixed(2) + "TB";
}
} else {
return Memory;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xmoj-script",
"version": "1.2.61",
"version": "1.2.62",
"description": "an improvement script for xmoj.tech",
"main": "AddonScript.js",
"scripts": {
Expand Down