Skip to content

Tiny module to calculate the fees of the tradingpost on GW2

License

Notifications You must be signed in to change notification settings

gw2efficiency/tradingpost-fees

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Tiny module to calculate the fees of the tradingpost on GW2

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published