在自定义根目录下 api/extend.func.php 函数文件中加上以下代码
//去.00转化为万 function formatNumber($number) { if (empty($number) || !is_numeric($number)) return $number; $unit = ""; if ($number > 10000) { $leftNumber = floor($number / 10000); $rightNumber = round(($number % 10000) / 10000, 2); // $rightNumber = bcmul(($number % 10000) / 10000, '1', 2); $number = floatval($leftNumber + $rightNumber); $unit = "万"; } else { $decimals = $number > 1 ? 2 : 6; $number = (float)number_format($number, $decimals, '.', ''); } return (string)$number . $unit; }