From 8e803c9a5163bbfb3f0a92392e993ce98402300d Mon Sep 17 00:00:00 2001 From: Zxilly Date: Fri, 27 Sep 2024 20:55:08 +0800 Subject: [PATCH] fix: force ac rate to display only two decimal places --- package-lock.json | 4 ++-- src/rpc/actionChain/chainNode/leetcode.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 195e06a..a3965be 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vscode-leetcode-problem-rating", - "version": "3.2.3", + "version": "3.2.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "vscode-leetcode-problem-rating", - "version": "3.2.3", + "version": "3.2.4", "license": "MIT", "dependencies": { "ansi-styles": "3.2.1", diff --git a/src/rpc/actionChain/chainNode/leetcode.ts b/src/rpc/actionChain/chainNode/leetcode.ts index 31cc963..81dad07 100644 --- a/src/rpc/actionChain/chainNode/leetcode.ts +++ b/src/rpc/actionChain/chainNode/leetcode.ts @@ -86,7 +86,7 @@ class LeetCode extends ChainNodeBase { slug: p.stat.question__title_slug, link: configUtils.sys.urls.problem.replace("$slug", p.stat.question__title_slug), locked: p.paid_only, - percent: (p.stat.total_acs * 100) / p.stat.total_submitted, + percent: ((p.stat.total_acs * 100) / p.stat.total_submitted).toFixed(2), level: commUtils.getNameByLevel(p.difficulty.level), starred: p.is_favor, category: json.category_slug, @@ -114,7 +114,7 @@ class LeetCode extends ChainNodeBase { slug: p.stat.question__title_slug, link: configUtils.sys.urls.problem.replace("$slug", p.stat.question__title_slug), locked: p.paid_only, - percent: (p.stat.total_acs * 100) / p.stat.total_submitted, + percent: ((p.stat.total_acs * 100) / p.stat.total_submitted).toFixed(2), level: commUtils.getNameByLevel(p.difficulty.level), starred: p.is_favor, category: json.category_slug,