vat-rate-calculator
v1.0.1
Published
This module provides from the standard value added tax calculation formula
Downloads
3
Maintainers
Readme
VAT calculator
This module provides from the standard value added tax calculation formula who is below
HT = ATI / (1 + decimal of VAT)
ATI = TF * (1 + decimal of VAT)
VAT = TF * (decimal of VAT)
NOTE:
decimal value of VAT => VAT rate/100
VAT => value added tax
TF => tax free
ATI => all tax included
Installation
This is a Node.js module available through the
npm registry. Installation is done using the
npm install
command:
$ npm install vat-rate-calculator
API
const calculator = require('vat-rate-calculator')
calculator('TF', amount-ati, vat-rate)
Or
calculator(amount-ati, vat-rate)
Returns the value excluding tax of a given amount
calculator('TF',59000,18) // => 50000
calculator(59000,18) // => 50000
calculator('ATI', amount-tf, vat-rate)
Returns the all tax included of a given amount
calculator('ATI',50000,18) // => 59000
calculator('VAT', amount-tf, vat-rate)
Returns the value added tax of a given amount
calculator('VAT',59000,18) // => 9000
calculator.sum(...args)
Returns sum total of the args
calculator.sum(1,2,3,4,5)// => 15