gw2-coin
TypeScript icon, indicating that this package has built-in type declarations

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) + '');

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.4
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.4
    0
  • 1.0.3
    0
  • 1.0.2
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i gw2-coin

Weekly Downloads

0

Version

1.0.4

License

ISC

Last publish

Collaborators

  • bluelovers