sales-tax-cad

1.0.0 • Public • Published

🧾 Canadian sales tax calculator

Status Coverage Status

This package exports a single class. It's rather small and only does one thing: calculate CAD taxes. For those who just care about the total, you can call sum, as shown below, or you can get a tax trace using get.

Note that the constructor takes three arguments:

  1. The two-letter province code;
  2. The taxable number value;
  3. The number of decimal points to include in output.
  const SalesTax = require('sales-tax-cad');
  
  const tax = new SalesTax(
    'ON', // reference rates.json if unsure
    21.41, // ensure that this is a number
    2, // leave blank for raw result
  );
 
  tax.get(); // returns an array of all chargeable taxes
  tax.sum(); // returns the total payable tax
Method Description
get Returns an array of applicable taxes
get Returns the total payable tax (reduces get results)

Rate table

As of February 1, 2020
Province Tax GST HST QST PST Total
Alberta GST 5% -- -- -- 5%
British Columbia GST + PST 5% -- -- 7% 12%
Manitoba GST + PST 5% -- -- 7% 12%
New Brunswick HST -- 15% -- -- 15%
Newfoundland and Labrador HST -- 15% -- -- 15%
Northwest Territories GST 5% -- -- -- 5%
Nova Scotia HST -- 15% -- -- 15%
Nunavut GST 5% -- -- -- 5%
Ontario HST -- 13% -- -- 13%
Prince Edward Island HST -- 15% -- -- 15%
Quebec GST + QST 5% -- 9.975% -- 14.98%
Saskatchewan GST + PST 5% -- -- 6% 11%
Yukon GST 5% -- -- -- 5%

Readme

Keywords

none

Package Sidebar

Install

npm i sales-tax-cad

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

11.7 kB

Total Files

17

Last publish

Collaborators

  • 3merge