From 4aa7c24ba4d56c49d25d55e69389c966872f5356 Mon Sep 17 00:00:00 2001 From: Zephyruso <127948745+Zephyruso@users.noreply.github.com> Date: Sat, 2 Sep 2023 10:44:13 +0800 Subject: [PATCH] fix: bytesize in subs info --- src/components/SubscriptionInfo.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/SubscriptionInfo.tsx b/src/components/SubscriptionInfo.tsx index 06b40a9..5bca09f 100644 --- a/src/components/SubscriptionInfo.tsx +++ b/src/components/SubscriptionInfo.tsx @@ -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) *