Get unlimited public & private packages + team-based management with npm Teams.Learn more »

gw2-coin

1.0.4 • Public • Published

gw2-coin

convert number to game unit currency (default: gw2)

Install

npm install gw2-coin

defaultOptions

{
    unit: 2,
    unit_level: 3,
    unit_names: [
        'G',
        'S',
        'C',
    ],
}

Usage

import Coin from 'gw2-coin';

let n = 123450709;

let options = {};

let a = (new Coin(options)).toCoinObject(n);

console.log(a, a + '');

console.log(b.toString(1));
console.log(b.toJSON(1));
console.log(b.toNumber());
console.log(b.toArray());

let toCoin = Coin.init(options);

console.log(toCoin(n), toCoin(n) + '');

let toCoin2 = (new Coin(options)).toCoinObject;

console.log(toCoin2(n), toCoin2(n) + '');

Keywords

none

Install

npm i gw2-coin

DownloadsWeekly Downloads

0

Version

1.0.4

License

ISC

Last publish

Collaborators

  • avatar