mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-24 09:45:35 +08:00
fix: bytesize in subs info
This commit is contained in:
parent
265c6cba9e
commit
4aa7c24ba4
@ -3,8 +3,10 @@ import dayjs from 'dayjs'
|
||||
import type { SubscriptionInfo } from '~/types'
|
||||
|
||||
const getSubscriptionsInfo = (subscriptionInfo: SubscriptionInfo) => {
|
||||
const total = byteSize(subscriptionInfo.Total)
|
||||
const used = byteSize(subscriptionInfo.Download + subscriptionInfo.Upload)
|
||||
const total = byteSize(subscriptionInfo.Total, { units: 'iec' })
|
||||
const used = byteSize(subscriptionInfo.Download + subscriptionInfo.Upload, {
|
||||
units: 'iec',
|
||||
})
|
||||
const percentage = (
|
||||
((subscriptionInfo.Download + subscriptionInfo.Upload) /
|
||||
subscriptionInfo.Total) *
|
||||
|
Loading…
Reference in New Issue
Block a user