2021
12-11
12-11
php对数字进行万、亿单位的转化
php对数字进行万。亿的转化/***格式化数字*/publicfunctionfloat_number($number){$length=strlen($number);//数字长度if($length>8){//亿单位$str=substr_replace(strstr($number,substr($number,-7),''),'.',-1,0)."亿";}elseif($length>4){//万单位//截取前俩为$str=substr_replace(strstr($number,substr($number,-3),''),'.',-1,0)."万";}else{return$...
继续阅读 >