// 数字输出美化 if (!function_exists('digitalDisplay')) { function digitalDisplay($number) { if (empty($number) || !is_numeric($number)) { return $number; } if (is_nan($number) || is_infinite($number)) { return 0; } if ($number >= 10000) { if($number%10000==0){ return number_format($number/10000,0,'.','').'万'; } if($number%1000==0){ return number_format($number/10000,1,'.','').'万'; } return number_format($number/10000,2,'.','').'万'; } if ($number >= 100000000) { if($number%100000000==0){ return number_format($number/10000,0,'.','').'亿'; } if($number%10000000==0){ return number_format($number/10000,1,'.','').'亿'; } return number_format($number/100000000,2,'.','').'亿'; } } }
数字输出美化
最新推荐文章于 2024-08-23 16:53:34 发布