4.2.0 • Published 1 year ago

@paylike/currencies v4.2.0

Weekly downloads
10
License
MIT
Repository
github
Last release
1 year ago

Currencies

List of currencies supported by Paylike for transactions and accounts.

Currencies flagged deprecated are no longer supported.

Read more:

Account currencies

These are the currencies you can use as a base for your account. Also known as account, settlement and funding currency.

Global

  • EUR (Euro)
  • USD (United States dollar)
  • GBP (British pound sterling)

Nordic

  • DKK (Danish krone)
  • NOK (Norwegian krone)
  • SEK (Swedish krona)

Other EU

  • CHF (Swiss franc)
  • HUF (Hungarian forint)
  • PLN (Polish złoty)
  • RON (Romanian leu)
  • CZK (Czech koruna)
  • BGN (Bulgarian lev)

Usage

Within the Paylike ecosystem you should use the code to refer to a currency.

var currencies = require('@paylike/currencies')

currencies
/*
	[
		{
			code: 'AED',
			currency: 'United Arab Emirates dirham',
			numeric: '784',
			exponent: 2,
		},
		...
		{
			code: 'DKK',
			currency: 'Danish krone',
			numeric: '208',
			exponent: 2,
			funding: true,
		},
		...
	]
	*/

// lookup by code
currencies.byCode('AED')
// { code: 'AED', currency: 'United Arab Emirates dirham', numeric: '784' }

currencies.byCode()
// Map()

// list supported funding currencies
currencies.filter((x) => x.funding).map((x) => x.currency)
/*
	[
		'Bulgarian lev',
		'Swiss franc',
		'Czech koruna',
		'Danish krone',
		'Euro',
		'Pound sterling',
		'Croatian kuna',
		'Hungarian forint',
		'Norwegian krone',
		'Polish złoty',
		'Romanian leu',
		'Swedish krona',
		'United States dollar',
	]
	*/

// Convert between minor and major respecting the exponent
currencies.toMinor('DKK', 100.0)
// 10000

currencies.toMajor('DKK', 10000)
// 100.00
4.2.0

1 year ago

4.1.0

1 year ago

4.0.0

2 years ago

3.5.0

3 years ago

3.4.0

6 years ago

3.3.0

6 years ago

3.2.0

6 years ago

3.1.0

7 years ago

3.0.2

7 years ago

3.0.1

7 years ago

3.0.0

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.1

8 years ago

1.0.0

8 years ago