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
- Host: GitHub
- URL: https://github.com/alivekeep/currency-transformation
- Owner: Alivekeep
- Created: 2021-04-12T09:12:27.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-12T12:50:43.000Z (about 5 years ago)
- Last Synced: 2025-02-21T21:37:59.653Z (over 1 year ago)
- Language: TypeScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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);
```