1.1.1 • Published 4 years ago

gw2e-tradingpost-fees v1.1.1

Weekly downloads
12
License
MIT
Repository
github
Last release
4 years ago

tradingpost-fees

Build Status Coverage Status

Tiny module to calculate the fees of the tradingpost on GW2

This is part of gw2efficiency. Please report all issues in the central repository.

Install

npm install gw2e-tradingpost-fees

This module can be used for Node.js as well as browsers using Browserify.

Usage

import {subFees, subTax, subListing, listingFee, tax} from 'gw2e-tradingpost-fees'

// Subtract both the 5% listing fee and the 10% tax
subFees(100000)
// -> 85000

// Subtract the 10% tax
subTax(100000)
// -> 90000

// Subtract the 5% listing fee
subListing(100000)
// -> 95000

// Get the 10% tax
tax(100000)
// -> 10000

// Get the 5% listing fee
listingFee(100000)
// -> 5000

But why not just price * 0.85?

Because that's not how it works ingame. It is missing that there is a minimum of 1 copper for the listing fee, tax, as well as propper rounding. Yes, that makes a difference for cheap items.

Tests

npm test

Licence

MIT

1.1.1

4 years ago

1.1.0

7 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago