{"id":19905175,"url":"https://github.com/ossphilippines/use-money","last_synced_at":"2025-05-03T01:33:41.779Z","repository":{"id":89983356,"uuid":"537732608","full_name":"OSSPhilippines/use-money","owner":"OSSPhilippines","description":"A Vue 3 component and composable for formatting money","archived":false,"fork":false,"pushed_at":"2023-10-07T19:15:19.000Z","size":183,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-01T09:42:56.149Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"","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/OSSPhilippines.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}},"created_at":"2022-09-17T07:27:58.000Z","updated_at":"2024-02-21T04:17:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"fcfce2ac-adf9-451a-b164-184e81d79b41","html_url":"https://github.com/OSSPhilippines/use-money","commit_stats":null,"previous_names":["ossphilippines/money"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSSPhilippines%2Fuse-money","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSSPhilippines%2Fuse-money/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSSPhilippines%2Fuse-money/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSSPhilippines%2Fuse-money/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OSSPhilippines","download_url":"https://codeload.github.com/OSSPhilippines/use-money/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224346421,"owners_count":17296214,"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":["hacktoberfest"],"created_at":"2024-11-12T20:31:52.439Z","updated_at":"2024-11-12T20:32:40.306Z","avatar_url":"https://github.com/OSSPhilippines.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 💸 Use Money 💰\n\n## Installation\n\nInstall the @ossph/use-money package using npm or yarn:\n\n```bash\nnpm install @ossph/use-money\n\n```\nor \n\n```bash\nyarn add @ossph/use-money\n\n```\n\n## Money Component\n\n### Importing the Component\n\nTo use the **Money** component, import it as follows:\n\n```js\nimport { Money } from '@ossph/use-money';\n```\n\n### Example Usage\n\nUse the **Money** component in your Vue templates as follows:\n\n```html\n\u003ctemplate\u003e\n  \u003cdiv\u003e\n    \u003cMoney :input=\"123456.78\" /\u003e\n  \u003c/div\u003e\n\u003c/template\u003e\n\n\u003cscript\u003e\nimport { Money } from '@ossph/use-money';\n\nexport default {\n  components: {\n    Money\n  }\n};\n\u003c/script\u003e\n\n```\n\n### Props API\n\nThe `Money` component accepts the following props:\n\n| Prop Name      | Type                | Default | Description                                        |\n|----------------|---------------------|---------|----------------------------------------------------|\n| `input`        | Number/String       |         | The input money value to be formatted.            |\n| `symbol`       | String              | '$'     | The currency symbol.                              |\n| `symbolStyles` | Object              | {}      | CSS styles for the currency symbol.               |\n| `symbolClasses`| Array               | []      | CSS classes for the currency symbol.              |\n| `textStyle`    | Object              | {}      | CSS styles for the text.                          |\n| `showSymbol`   | Boolean             | false   | Whether to show the currency symbol.              |\n| `showFractional` | Boolean            | false  | Whether to show the fractional part of the money value. |\n\n\n\n## Money Composable\n\n### Importing the Composable\n\nTo use the **useMoney** composable, import it as follows:\n\n```js\nimport { useMoney } from '@ossph/use-money';\n```\n\n### Example Usage\n\nUse the useMoney composable in your Vue composition functions as follows:\n\n```js\n\u003ctemplate\u003e\n  \u003cdiv\u003e\n    \u003cp\u003eFormatted Money Value: {{ formattedMoney }}\u003c/p\u003e\n  \u003c/div\u003e\n\u003c/template\u003e\n\n\u003cscript\u003e\nimport { useMoney } from '@ossph/use-money';\n\nexport default {\n  setup() {\n    const { moneyValue } = useMoney(123456.78);\n    \n    return {\n      formattedMoney: moneyValue\n    };\n  }\n};\n\u003c/script\u003e\n```\n\n### Composable API\n\nThe `useMoney` composable takes the following parameters:\n\n| Prop Name  | Type               | Default                                          | Description                                        |\n|------------|--------------------|--------------------------------------------------|----------------------------------------------------|\n| `value`    | Number/String      |                                                  | The input money value to be formatted.            |\n| `options`  | Object             | `{ showFractional: true, showSymbol: true, symbol: '$' }` | Formatting options for money value.        |\n| `showFractional` | Boolean        | `true`                                           | Whether to show the fractional part of the money value. |\n| `showSymbol`     | Boolean        | `true`                                           | Whether to show the currency symbol.               |\n| `symbol`         | String         | `'$'`                                            | The currency symbol.                              |\n\n\nIt returns an object with the following properties:\n\n| Property           | Type   | Description                                        |\n|--------------------|--------|----------------------------------------------------|\n| `moneyValue`       | String | The formatted integer part of the money value.    |\n| `moneyFractional`  | String | The original fractional part.                     |\n| `moneySymbol`      | String | The currency symbol.                              |\n| `moneyConcatenated`| String | The concatenated value with the currency symbol.  |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fossphilippines%2Fuse-money","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fossphilippines%2Fuse-money","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fossphilippines%2Fuse-money/lists"}