Merge pull request #16752 from hjoelr/bugfix-double-precision

Bugfix: wc_remove_number_precision() indirectly called twice from get_discount()
This commit is contained in:
Mike Jolley 2017-09-08 10:57:09 +01:00 committed by GitHub
commit 1f1903bcf4
1 changed files with 1 additions and 1 deletions

View File

@ -131,7 +131,7 @@ class WC_Discounts {
*/
public function get_discount( $key, $in_cents = false ) {
$item_discount_totals = $this->get_discounts_by_item( $in_cents );
return isset( $item_discount_totals[ $key ] ) ? ( $in_cents ? $item_discount_totals[ $key ] : wc_remove_number_precision( $item_discount_totals[ $key ] ) ) : 0;
return isset( $item_discount_totals[ $key ] ) ? $item_discount_totals[ $key ] : 0;
}
/**