Allow wc_format_decimal() return negative values

This commit is contained in:
Claudio Sanches 2017-02-24 15:58:02 -03:00
parent dadf4d12eb
commit 3e7e9dafb1
1 changed files with 1 additions and 1 deletions

View File

@ -256,7 +256,7 @@ function wc_format_decimal( $number, $dp = false, $trim_zeros = false ) {
// Remove locale from string.
if ( ! is_float( $number ) ) {
$number = wc_clean( str_replace( $decimals, '.', $number ) );
$number = preg_replace( '/[^0-9\.,]/', '', $number );
$number = preg_replace( '/[^0-9\.,-]/', '', $number );
}
if ( false !== $dp ) {