Skip to content

Commit

Permalink
Update: change progress bar percentage to floor
Browse files Browse the repository at this point in the history
  • Loading branch information
PeiPei233 committed Jan 2, 2024
1 parent 9bff86e commit 937d3f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)}` : ''}</Text>
<Progress percent={downloadPercent}
format={(percent) => Math.round(percent) + '%'}
format={(percent) => Math.floor(percent) + '%'}
style={{
position: 'absolute',
bottom: 10,
Expand Down Expand Up @@ -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)}` : ''}</Text>
<Progress percent={downloadPercent}
format={(percent) => Math.round(percent) + '%'}
format={(percent) => Math.floor(percent) + '%'}
style={{
position: 'absolute',
bottom: 10,
Expand Down

0 comments on commit 937d3f3

Please sign in to comment.