Allow negative rounding (php does)

This commit is contained in:
Mike Jolley 2017-12-04 20:27:30 +00:00
parent d98f6c96af
commit 6b37aa7b70
1 changed files with 1 additions and 1 deletions

View File

@ -229,7 +229,7 @@ function wc_trim_zeros( $price ) {
* @return double
*/
function wc_round_tax_total( $value, $precision = null ) {
$precision = is_null( $precision ) ? wc_get_price_decimals() : absint( $precision );
$precision = is_null( $precision ) ? wc_get_price_decimals() : intval( $precision );
if ( version_compare( PHP_VERSION, '5.3.0', '>=' ) ) {
$rounded_tax = round( $value, $precision, wc_get_tax_rounding_mode() );