public static function calc_tax($price, $rates, $price_includes_tax = false, $suppress_rounding = false)
{
// Work in pence to X precision
$price = self::precision($price);
if ($price_includes_tax) {
$taxes = self::calc_inclusive_tax($price, $rates);
} else {
$taxes = self::calc_exclusive_tax($price, $rates);
}
// Round to precision
if (!self::$round_at_subtotal && !$suppress_rounding) {
$taxes = array_map('round', $taxes);
// Round to precision
}
// Remove precision
$price = self::remove_precision($price);
$taxes = array_map(array(__CLASS__, 'remove_precision'), $taxes);
return apply_filters('woocommerce_calc_tax', $taxes, $price, $rates, $price_includes_tax, $suppress_rounding);
}