Use new code style

This commit is contained in:
David Stone
2025-02-07 19:02:33 -07:00
parent 0181024ae1
commit 8433379d90
672 changed files with 37107 additions and 45249 deletions

View File

@ -24,8 +24,7 @@ function wu_extract_number($str) {
preg_match_all('/\d+/', $str, $matches);
return isset($matches[0][0]) ? (int) $matches[0][0] : 0;
} // end wu_extract_number;
}
/**
* Converts formatted values back into floats.
@ -39,29 +38,20 @@ function wu_extract_number($str) {
function wu_to_float($num, $decimal_separator = false) {
if (is_float($num) || is_numeric($num)) {
return (float) $num;
} // end if;
}
if (empty($decimal_separator)) {
$decimal_separator = wu_get_setting('decimal_separator', '.');
} // end if;
}
if ($decimal_separator) {
$pattern = '/[^0-9\\' . $decimal_separator . '-]+/';
} else {
$pattern = '/[^0-9-]+/';
} // end if;
}
$val = preg_replace($pattern, '', (string) $num);
return floatval($val);
} // end wu_to_float;
}