Answers for "to redo number_format php"

PHP
0

to redo number_format php

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)));
}
Posted by: Guest on October-27-2021

Browse Popular Code Answers by Language