From a5e7f78a1f7b934906c838c802673709bce79d89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=98=AD?= <81747598+lan-yonghui@users.noreply.github.com> Date: Tue, 27 Aug 2024 13:39:18 +0800 Subject: [PATCH] =?UTF-8?q?pref:=20=E5=AE=8C=E5=96=84=E5=91=8A=E8=AD=A6?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E4=BB=BB=E5=8A=A1=20(#6263)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/utils/common/common.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/utils/common/common.go b/backend/utils/common/common.go index cc7e9eb2b..2695d947f 100644 --- a/backend/utils/common/common.go +++ b/backend/utils/common/common.go @@ -338,3 +338,7 @@ func FormatBytes(bytes uint64) string { return fmt.Sprintf("%.2fGB", float64(bytes)/float64(gb)) } } + +func FormatPercent(percent float64) string { + return fmt.Sprintf("%.2f%%", percent) +}