Currency formatter
npm install @touch4it/currency-format




``bash`
$ npm install --save @touch4it/currency-format
Object constructor
__Options:__
- amount (required) - Price amountcurrency
- (optional, default: USD) - Price currency
Print string with correct number of decimal places
__Options:__
- decimals (optional, default: calculated from currency) - Decimal places in output
__Return:__
Formatted string
Add amount to previous amount
__Options:__
- amount (required) - Amount to be added
__Return:__
Object (this)
Subtract amount from previous amount
__Options:__
- amount (required) - Amount to be subtracted
__Return:__
Object (this)
Calculate VAT amount
__Options:__
- vatPercent (required) - Percent of VAT as number (e.g. 40 for 40%)
__Return:__
VAT amount as string with correct number of decimal places
Add VAT amount to previous amount
__Options:__
- vatPercent (required) - Percent of VAT as number (e.g. 40` for 40%)
__Return:__
Object (this)
See tests
MIT