product-tax
v1.0.5
Published
Utility to calculate prices on goods, with tax & discount
Downloads
14
Readme
Getting Started
<script src="https://unpkg.com/product-tax"></script>
Usage
var taxPercent = 20
var discount = 30
var finalPrice = 29.4
var basePrice = tax.final.discount.percent(taxPercent, discount, finalPrice)
// => 35
This will calculate the base price from the final price with tax and discount percent applied
Examples
git clone https://github.com/sambarrowclough/fws-product-tax.git
cd fws-product-tax
npm i
npm start
Test
npm test
Formulas
From base with tax, discount applied
@params net (base), rate (tax), percent (discountPercent)