Function __global->backcalculate_tax_rate

Definitions

sources/ecommerce_tax.php

  • Work out the tax rate for a given payment amount and flat tax figure.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: float

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$amount REAL No No required parameter N/A N/A Amount
$tax REAL No No required parameter N/A N/A Tax in money

Returns

  • The tax rate (as a percentage)
  • Type: REAL
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Work out the tax rate for a given payment amount and flat tax figure.
 *
 * @param  REAL $amount Amount
 * @param  REAL $tax Tax in money
 * @return REAL The tax rate (as a percentage)
 */

function backcalculate_tax_rate(float $amount, float $tax) : float