From 7b77e96018f148afb77d3c8f96dc162b205cf59d Mon Sep 17 00:00:00 2001 From: "iVampireSP.com" Date: Tue, 17 Jan 2023 14:34:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=20=E6=89=A3=E8=B4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/Host.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/Models/Host.php b/app/Models/Host.php index 6711e6a..4f93f99 100644 --- a/app/Models/Host.php +++ b/app/Models/Host.php @@ -188,12 +188,11 @@ public function cost(string $amount = null, $auto = true): bool $days = now()->daysInMonth; // 本月每天的每小时的价格 // 使用 bcmath 函数,解决浮点数计算精度问题 - $real_price = bcdiv($real_price, $days, 4); - $real_price = bcdiv($real_price, 24, 4); + $real_price = bcdiv($real_price, $days, 8); + $real_price = bcdiv($real_price, 24, 8); } if ($real_price == 0) { - echo '价格为 0,不扣费'; return true; }