Skip to content

Latest commit

 

History

History
58 lines (39 loc) · 1.43 KB

README.md

File metadata and controls

58 lines (39 loc) · 1.43 KB

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