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

https://github.com/codad5/react-currencynet

React library that help to convert your web app currency to its user currency based on ther location
https://github.com/codad5/react-currencynet

currency javascript library npm-package react reactjs

Last synced: over 1 year ago
JSON representation

React library that help to convert your web app currency to its user currency based on ther location

Awesome Lists containing this project

README

          

# CUURENCYNET REACT VERSION

> Currencynet is a javascript light library that helps to convert currency between different html tags

## Documentation : Usage

### Installing Currencynet

```bash
npm i currencynet
```

or

```bash
yarn add currencynet
```

### Import Currencynet

Create a new currencyNet Object

```js
import { CurrencyNet } from 'currencynet'
```

Now add your the `CurrencyNet` jsx element

```jsx

```

`buildCurrency` - This can be replaced by any of [ISO 4217 CODE](https://en.wikipedia.org/wiki/ISO_4217) based on the currency used in that element

`value` - This is the value of the element in your build currency

`isfloat` - (optional) - This is an optional parameter that determine if the currency should be returned as a float or not , `default` is true

`shortenCurrency` - (optional) - This is an optional param for formatting currencies in shorten form e.g `$1200` becomes `$1.2k`

### Using it in a Component

As seen we will always have to redeclare the `buildCurrency` when using it in a component which can be very exhausting , so for best pratice you can create a default component to be used through out your application

```jsx
import React from 'react'
import {CurrencyNet} from 'currencynet'

//Using props
const MyDollarCurrency = (props) => {
return (

)
}
// Using Children
const MyEuroCurrency = ({children}) => {
return (

)
}
export default const App = () => {
return (




10

)
}
```

# New Currency Formatter

```jsx

```

## Adding a dropdown option

```html
coming soon
```

### For all Example visit [here](https://playcode.io/952114)

### For all Example result visit [here](https://currencynet.playcode.io)

### Table for all avaliable currency class

| COUNTRY | ISO 4217 CODE | CLASSNAME |
| :---: | :---:| :---|
| US Dollar | USD | currencynet-init-usd |
| Indian Rupee | INR | currencynet-init-inr |
| Euro | EUR | currencynet-init-eur |
| Chinese Yuan | CYN | currencynet-init-cyn |
| Nigerian Naira| NGN | currencynet-init-ngn |

more are avaliable at [our documentation](https://codad5.github.io/currencynet/#country_table)

#### TODO

- [ ] Making a google web crawler to make the application use it own personal currency converter
- [ ] Fix Documentation UI