From 965bb883f5d2cf59e24c0d299c4a4e9aa427a561 Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Tue, 20 Jun 2023 19:45:49 +0800 Subject: [PATCH] format decimals --- src/libs/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/utils.ts b/src/libs/utils.ts index 11927014..06ac2276 100644 --- a/src/libs/utils.ts +++ b/src/libs/utils.ts @@ -113,10 +113,10 @@ export function formatSeconds(value?: string) { if(!value) return '' const duration = Number(value.replace(/s/, '')) if(duration > 24*60*60) { - return `${duration / ( 24 * 60 * 60)} days` + return `${(duration / ( 24 * 60 * 60)).toFixed()} days` } if(duration > 60*60) { - return `${duration / (60 * 60)} hours` + return `${duration / (60 * 60).toFixed()} hours` } if(duration > 60) { return `${duration / 60} mins`