/**
 * 格式化千米 米 公里
 * @param string $s 米
 * @return string 距离
 * @author 萤火虫 123246359@qq.com
 */
function formatlength($s){
    $qianmi = round($s/1000,2);
    if($s>0 && $qianmi<1){
        return round($s,2).'米';
    }else if($qianmi>1){
        return $qianmi.'公里';
    }
}

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论
立即
投稿
发表
评论
返回
顶部