mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-14 06:25: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'
|
import type { SubscriptionInfo } from '~/types'
|
||||||
|
|
||||||
const getSubscriptionsInfo = (subscriptionInfo: SubscriptionInfo) => {
|
const getSubscriptionsInfo = (subscriptionInfo: SubscriptionInfo) => {
|
||||||
const total = byteSize(subscriptionInfo.Total)
|
const total = byteSize(subscriptionInfo.Total, { units: 'iec' })
|
||||||
const used = byteSize(subscriptionInfo.Download + subscriptionInfo.Upload)
|
const used = byteSize(subscriptionInfo.Download + subscriptionInfo.Upload, {
|
||||||
|
units: 'iec',
|
||||||
|
})
|
||||||
const percentage = (
|
const percentage = (
|
||||||
((subscriptionInfo.Download + subscriptionInfo.Upload) /
|
((subscriptionInfo.Download + subscriptionInfo.Upload) /
|
||||||
subscriptionInfo.Total) *
|
subscriptionInfo.Total) *
|
||||||
|
Loading…
Reference in New Issue
Block a user