vat-rate-calculator

1.0.1 • Public • Published

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

License

MIT

Package Sidebar

Install

npm i vat-rate-calculator

Weekly Downloads

4

Version

1.0.1

License

MIT

Unpacked Size

5.91 kB

Total Files

3

Last publish

Collaborators

  • amasyll