|
在 include\extend.func.php 最下面加个函数
01
function click_round_number( $number, $min_value = 1000] $decimal = 1 ) {
02
if( $number
03
return $number;
04
}
05
$alphabets = array( 100000000 => '亿', 10000 => '万', 1000 => '千' );
06
foreach( $alphabets as $key => $value )
07
if( $number >= $key ) {
08
return round( $number / $key, $decimal ) . '' . $value;
09
}
10
}
调用标签如下:
1
{dede:field.click function="click_round_number(@me)"/}
效果:
1000=1千;
15000=1.5万;
210000=21万。 |
|