@pathmaker-digital/pmd-utilities - v2.2.6
    Preparing search index...

    Function calculateTax

    • Calculates the tax amount for a given subtotal and tax rate.

      Parameters

      • subtotal: number

        The pre-tax amount.

      • taxRate: number

        The tax rate as a percentage (e.g., 8.25 for 8.25%).

      Returns number

      The tax amount, rounded to 2 decimal places.

      const tax = calculateTax(100, 8.25);
      console.log(tax); // Output: 8.25