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
- Host: GitHub
- URL: https://github.com/codad5/react-currencynet
- Owner: codad5
- License: other
- Created: 2022-08-18T21:24:44.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-12-06T04:32:19.000Z (over 3 years ago)
- Last Synced: 2025-02-28T04:47:08.494Z (over 1 year ago)
- Topics: currency, javascript, library, npm-package, react, reactjs
- Language: TypeScript
- Homepage: https://codad5.github.io/currencynet
- Size: 38.1 MB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
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