📜  重做 number_format php 代码示例

📅  最后修改于: 2022-03-11 14:54:36.042000             🧑  作者: Mango

代码示例1
function parse_number($number, $dec_point=null) {
    if (empty($dec_point)) {
        $locale = localeconv();
        $dec_point = $locale['decimal_point'];
    }
    return floatval(str_replace($dec_point, '.', preg_replace('/[^\d'.preg_quote($dec_point).']/', '', $number)));
}