From bc751a2672c7c16b441b83b56e1a0b24703c3c0e Mon Sep 17 00:00:00 2001 From: yangyin <1850366751@qq.com> Date: 星期三, 20 十一月 2024 14:07:38 +0800 Subject: [PATCH] 提交注释 --- src/utils/util.ts | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/src/utils/util.ts b/src/utils/util.ts index 77895cf..d92279e 100644 --- a/src/utils/util.ts +++ b/src/utils/util.ts @@ -547,6 +547,7 @@ const endDate = new Date(); const startDate = new Date(); startDate.setTime(startDate.getTime() - 3600 * 1000 * 24 * dates); + endDate.setHours(23,59,59,59) startDate.setHours(0, 0, 0, 0); return [startDate, endDate]; }; @@ -629,6 +630,21 @@ return percent; }; + + +/** + * 淇濈暀鎸囧畾绮惧害灏忔暟浣嶏紝涓斾笉琛ラ浂 + * @param num + * @param precision + * @returns + */ +export const toMyFixed = (num, precision) => { + if (num == null) return ''; + if (!precision) return num + ''; + const factor = Math.pow(10, precision); + return Math.round(Number(num) * factor) / factor + ''; +}; + /** * * @param {*} func 闃叉姈鍑芥暟 -- Gitblit v1.9.3