An open API service indexing awesome lists of open source software.

https://github.com/alivekeep/currency-transformation

Currency transformation util
https://github.com/alivekeep/currency-transformation

Last synced: over 1 year ago
JSON representation

Currency transformation util

Awesome Lists containing this project

README

          

# Currency transformation util

### Installation

```bash
yarn add currency-transformation
```

### How to usage

```typescript
import { CurrencyTransformation, CurrencyList } from 'currency-transformation';

const currencyTransformation = new CurrencyTransformation();

const amount = currencyTransformation.convert({
amount: 100,
from: CurrencyList.USD,
to: CurrencyList.UAH,
baseCurrency: CurrencyList.UAH, // should be 1 as value in rates list
moneyFormat: true,
crossFormat: false,
rates: {
EUR: 29.67359,
GBP: 33.4715,
RUB: 0.37,
USD: 27.17391,
UAH: 1
}
});

console.log(amount);
```