{"id":16049999,"url":"https://github.com/codad5/react-currencynet","last_synced_at":"2025-03-17T21:31:15.267Z","repository":{"id":58930897,"uuid":"526377232","full_name":"codad5/react-currencynet","owner":"codad5","description":"React library that help to convert your web app currency to its user currency based on ther location","archived":false,"fork":false,"pushed_at":"2022-12-06T04:32:19.000Z","size":39934,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T04:47:08.494Z","etag":null,"topics":["currency","javascript","library","npm-package","react","reactjs"],"latest_commit_sha":null,"homepage":"https://codad5.github.io/currencynet","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codad5.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-18T21:24:44.000Z","updated_at":"2023-06-28T16:19:17.000Z","dependencies_parsed_at":"2023-01-23T14:46:02.863Z","dependency_job_id":null,"html_url":"https://github.com/codad5/react-currencynet","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codad5%2Freact-currencynet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codad5%2Freact-currencynet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codad5%2Freact-currencynet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codad5%2Freact-currencynet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codad5","download_url":"https://codeload.github.com/codad5/react-currencynet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243885934,"owners_count":20363644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["currency","javascript","library","npm-package","react","reactjs"],"created_at":"2024-10-09T00:41:40.850Z","updated_at":"2025-03-17T21:31:14.889Z","avatar_url":"https://github.com/codad5.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\r\n# CUURENCYNET REACT VERSION\r\n\r\n\u003e Currencynet is a javascript light library that helps to convert currency between different html tags\r\n\r\n## Documentation : Usage\r\n\r\n### Installing Currencynet\r\n\r\n```bash\r\nnpm i currencynet\r\n```\r\n\r\nor\r\n\r\n```bash\r\nyarn add currencynet\r\n```\r\n\r\n### Import Currencynet\r\n\r\n Create a new currencyNet Object\r\n\r\n```js\r\nimport { CurrencyNet } from 'currencynet'\r\n```\r\n\r\nNow add your the `CurrencyNet` jsx element\r\n\r\n```jsx\r\n\u003cCurrencyNet buildCurrency=\"USD\" value={10} isfloat={false} shortenCurrency={true} /\u003e\r\n```\r\n\r\n`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\r\n\r\n`value` - This is the value of the element in your build currency\r\n\r\n`isfloat` - (optional) - This is an optional parameter that determine if the currency should be returned as a float or not , `default` is true\r\n\r\n`shortenCurrency` - (optional) - This is an optional param for formatting currencies in shorten form e.g `$1200` becomes `$1.2k`\r\n\r\n### Using it in a Component\r\n\r\nAs 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\r\n\r\n```jsx\r\nimport React from 'react'\r\nimport {CurrencyNet} from 'currencynet'\r\n\r\n//Using props\r\nconst MyDollarCurrency = (props) =\u003e {\r\n    return (\r\n        \u003cCurrencyNet buildCurrency=\"USD\" value={props.value} /\u003e\r\n    )\r\n}\r\n// Using Children\r\nconst MyEuroCurrency = ({children}) =\u003e {\r\n    return (\r\n        \u003cCurrencyNet buildCurrency=\"EUR\" value={Number(children)} /\u003e\r\n    )\r\n}\r\nexport default const App = () =\u003e {\r\n    return (\r\n        \u003cdiv class=\"App\"\u003e\r\n            \u003cMyDollarCurrency value={10} /\u003e\r\n            \u003cMyEuroCurrency\u003e\r\n                10\r\n            \u003c/MyEuroCurrency\u003e\r\n        \u003c/div\u003e\r\n\r\n    )\r\n}\r\n```\r\n\r\n# New Currency Formatter\r\n\r\n```jsx\r\n\u003cCurrencyNet buildCurrency=\"USD\" value={10} isfloat={false} shortenCurrency={true}/\u003e\r\n```\r\n\r\n## Adding a dropdown option\r\n\r\n```html\r\ncoming soon\r\n```\r\n\r\n### For all Example visit [here](https://playcode.io/952114)\r\n\r\n### For all Example result visit [here](https://currencynet.playcode.io)\r\n\r\n### Table for all avaliable currency class\r\n\r\n| COUNTRY | ISO 4217 CODE | CLASSNAME |\r\n| :---: | :---:| :---|\r\n| US Dollar | USD | currencynet-init-usd |\r\n| Indian Rupee | INR | currencynet-init-inr |\r\n| Euro  | EUR | currencynet-init-eur |\r\n| Chinese Yuan | CYN | currencynet-init-cyn |\r\n| Nigerian Naira| NGN | currencynet-init-ngn |\r\n\r\nmore are avaliable at [our documentation](https://codad5.github.io/currencynet/#country_table)\r\n\r\n#### TODO\r\n\r\n- [ ] Making a google web crawler to make the application use it own personal currency converter\r\n- [ ] Fix Documentation UI\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodad5%2Freact-currencynet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodad5%2Freact-currencynet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodad5%2Freact-currencynet/lists"}