Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nikhils4/react-currency-conv
React component as an npm package for currency conversion. Supports fetching the latest and historical currency exchange rate based on the input date along with specific precision.
https://github.com/nikhils4/react-currency-conv
converter currency currency-conversion exchange-rate historical-data npm package precision react
Last synced: about 2 months ago
JSON representation
React component as an npm package for currency conversion. Supports fetching the latest and historical currency exchange rate based on the input date along with specific precision.
- Host: GitHub
- URL: https://github.com/nikhils4/react-currency-conv
- Owner: nikhils4
- License: mit
- Created: 2020-10-06T08:21:17.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2020-10-08T11:08:29.000Z (about 4 years ago)
- Last Synced: 2024-04-29T06:45:48.048Z (8 months ago)
- Topics: converter, currency, currency-conversion, exchange-rate, historical-data, npm, package, precision, react
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/react-currency-conv
- Size: 324 KB
- Stars: 9
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-currency-conv
React component for currency conversion. Supports fetching latest and historical currency exchange rate based on the input date alongwith specific precision.
## Changes
## v1.1.0:
- Update documentation
- Minor bug fixes## Installation
```
npm install react-currency-conv --save
```## Integration
You can get the converted value as the output of the react component and style it according to your preference.
- from: Initial currency
- to: Target currency
- value: The amount that you want to get converted```javascript
import React from 'react';
import CurrencyConverter from 'react-currency-conv';export default class App extends React.Component {
render() {
return (
);
}
}
```## Precision
Specify a specific precision:
```javascript
// 2234.67 (default)
``````javascript
// 78.2482
```## Date
To get the exchange rate value form :-
```javascript
// NOTE: The date should be in `YYYY-MM-DD` format
```All other attributes are applied normally to the element. For example, you can integrate bootstrap styling as:
```javascript
```## Options
Option | Default Value | Description
----------------- | ------------- | -----------------------------------------------------------------------------------------
date | null | Date you want to fetch exchange rate of (YYYY-MM-DD)
precision | 2 | Number of digits after the decimal separator## Supported currencies
Code |
----------|
INR |
IDR |
ILS |
MXN |
USD |
ZAR |
NZD |
NOK |
CNY |
BGN |
TRY |
PLN |
SGD |
CHF |
THB |
JPY |
HRK |
RUB |
BRL |
CAD |
HKD |
ISK |
PHP |
DKK |
HUF |
CZK |
RON |
SEK |
AUD |
EUR |
MYR |
KRW |
GBP |