From 937d3f3115ddd7410820d1b10c584235b052e283 Mon Sep 17 00:00:00 2001 From: PeiPei233 <2503585731@qq.com> Date: Tue, 2 Jan 2024 17:08:28 +0800 Subject: [PATCH] Update: change progress bar percentage to floor --- src/Home.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Home.jsx b/src/Home.jsx index 4a9d69b..b4e36d1 100644 --- a/src/Home.jsx +++ b/src/Home.jsx @@ -528,7 +528,7 @@ function Learning({ downloading, setDownloading }) { }}>{downloading && totalSize !== 0 && !isNaN(totalSize) && speed === 0 ? `${bytesToSize(downloadedSize)} / ${bytesToSize(totalSize)} | 0 B/s` : downloading && totalSize !== 0 && !isNaN(totalSize) ? `${bytesToSize(downloadedSize)} / ${bytesToSize(totalSize)} | ${bytesToSize(speed)}/s 剩余 ${formatTime(timeRemaining)}` : ''} Math.round(percent) + '%'} + format={(percent) => Math.floor(percent) + '%'} style={{ position: 'absolute', bottom: 10, @@ -971,7 +971,7 @@ function Classroom({ downloading, setDownloading }) { textAlign: 'right' }}>{downloading && totalSize && totalSize !== 0 && !isNaN(totalSize) && !isNaN(timeRemaining) && isFinite(timeRemaining) ? `PPTs: ${downloadedSize}/${totalSize} | 预计剩余 ${formatTime(timeRemaining)}` : ''} Math.round(percent) + '%'} + format={(percent) => Math.floor(percent) + '%'} style={{ position: 'absolute', bottom: 10,