{"id":13810012,"url":"https://github.com/ignoreintuition/v-currency","last_synced_at":"2025-05-14T10:31:39.136Z","repository":{"id":83767870,"uuid":"124981397","full_name":"ignoreintuition/v-currency","owner":"ignoreintuition","description":"A plugin for formatting currency for different countries in Vue ","archived":false,"fork":false,"pushed_at":"2019-10-13T23:41:12.000Z","size":126,"stargazers_count":24,"open_issues_count":1,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-08-04T02:06:53.091Z","etag":null,"topics":["accounting","currency","hacktoberfest","javascript","plugin","vue","vue2","vuejs","vuejs2"],"latest_commit_sha":null,"homepage":"http://resurgencewebdesign.com/v-convert/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ignoreintuition.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-03-13T02:37:54.000Z","updated_at":"2023-03-14T19:35:19.000Z","dependencies_parsed_at":"2023-03-12T19:42:42.458Z","dependency_job_id":null,"html_url":"https://github.com/ignoreintuition/v-currency","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ignoreintuition%2Fv-currency","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ignoreintuition%2Fv-currency/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ignoreintuition%2Fv-currency/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ignoreintuition%2Fv-currency/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ignoreintuition","download_url":"https://codeload.github.com/ignoreintuition/v-currency/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254120624,"owners_count":22018024,"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":["accounting","currency","hacktoberfest","javascript","plugin","vue","vue2","vuejs","vuejs2"],"created_at":"2024-08-04T02:00:42.559Z","updated_at":"2025-05-14T10:31:38.784Z","avatar_url":"https://github.com/ignoreintuition.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Components \u0026 Libraries","UI组件","UI Components [🔝](#readme)","UI Components"],"sub_categories":["UI Components","杂","Miscellaneous"],"readme":"# v-currency\n\n\u003e A plugin for formatting currency in Vue.js\n\n## Usage\n\n```\n Vue.use(Currency, {\n  \"type\": \"USD\",\n  \"thousandSeparator\": true,\n });\n```\n\nIn order to use it in your components:\n\n```\nexport default {\n  name: 'Sample',\n  data () {\n    return {\n      moneys: [\n        100500.945, 15043.5, 9909, 210, 44.30, -24, 'tq1'\n      ]\n    }\n  },\n  methods: {\n    getMoneys(i) {\n      return this.$helpers.currency(this.moneys[i]);\n    },\n  },\n\n```\n\nTo change currency on the fly\n```\nonChange(e){\n  this.$helpers.changeCurrency(e.target.value);\n  this.$forceUpdate();\n}\n```\n\n## Supported formats\n* USD (US)\n* CAD (Canada)\n* EUR (Europe)\n* GBP (Great Britain)\n* JPY (Japan)\n* DEU (Germany)\n* BRA (Brazil)\n* FRA (France)\n* ITA (Italy)\n* CHE (Switzerland)\n* BGR (Bulgaria)\n\nIf the format is not explicitly defined in the ruleset will default to JavaScripts toLocaleString.  To create a custom format you can add rules to the components.  \n\n```\n\"YOUR_CUSTOM_CURRENCY\": {\n  \"symbol\": \"$_\", // preceding underscore places numbers before symbol.  succeeding underscore places numbers after symbol\n  \"thousandSeperator\": 0, // (0: comma || 1: decimal || 2: space || 3: apostrophe)\n  \"decimalSeperator\": 0, // (0: decimal || 1: comma || 2: space)\n  \"negativePattern\": 2 // (0: symbol before || 1: symbol after || 2: Parenthesis)\n},\n```\n\n## Build Setup\n\n``` bash\n# install dependencies\nnpm install\n\n# serve with hot reload at localhost:8080\nnpm run dev\n\n# build for production with minification\nnpm run build\n\n# build for production and view the bundle analyzer report\nnpm run build --report\n```\n\nFor a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fignoreintuition%2Fv-currency","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fignoreintuition%2Fv-currency","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fignoreintuition%2Fv-currency/lists"}