public function numberFilter($number){if ($number <= 1000) {return $number;}$currentValue = $currentUnit = null;$unitExps = array('千' => 3, '万' => 4, '亿' => 8);foreach ($unitExps as $unit => $exp) {$divisor = pow(10, $exp);$currentUnit = $unit;$currentValue = $number / $divisor;if ($currentValue < 10) {break;}}return sprintf('%.0f', $currentValue).$currentUnit;}
