diff --git a/number2chinese.php b/number2chinese.php index 5080a76..4d37934 100644 --- a/number2chinese.php +++ b/number2chinese.php @@ -100,7 +100,7 @@ function number2chinese($number, $isRmb = false) // 小数部分拼接 $decimalRes = ''; - $count = strlen($decimal); + $count = strlen($decimal ?? ''); if ($decimal === null) { $decimalRes = $isRmb ? '整' : ''; } else if ($decimal === '0') {