{"id":22538040,"url":"https://github.com/cfpb/format-usd","last_synced_at":"2025-04-09T20:15:01.133Z","repository":{"id":18863837,"uuid":"22080633","full_name":"cfpb/format-usd","owner":"cfpb","description":"Convert a number or string to a USD-formatted string","archived":false,"fork":false,"pushed_at":"2023-01-09T19:33:25.000Z","size":103,"stargazers_count":5,"open_issues_count":1,"forks_count":6,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-03-23T22:11:21.800Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cfpb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"COPYING.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-21T21:19:20.000Z","updated_at":"2024-03-29T18:21:19.000Z","dependencies_parsed_at":"2023-01-13T20:30:17.737Z","dependency_job_id":null,"html_url":"https://github.com/cfpb/format-usd","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfpb%2Fformat-usd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfpb%2Fformat-usd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfpb%2Fformat-usd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfpb%2Fformat-usd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cfpb","download_url":"https://codeload.github.com/cfpb/format-usd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247947823,"owners_count":21023058,"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":[],"created_at":"2024-12-07T11:09:54.201Z","updated_at":"2025-04-09T20:15:01.106Z","avatar_url":"https://github.com/cfpb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# format-usd [![Build Status](https://secure.travis-ci.org/cfpb/format-usd.png?branch=master)](http://travis-ci.org/cfpb/format-usd)\n\n\u003e Convert a number or string to a United States dollar-formatted string\n\n## Installation\n\nFirst install [node.js](http://nodejs.org/). Then:\n\n```sh\nnpm install format-usd --save\n```\n\n## Usage\n\n```javascript\nvar formatUSD = require('format-usd');\nformatUSD({ amount: 9000 }); // '$9,000.00'\nformatUSD({ amount: '$9000' }); // '$9,000.00'\nformatUSD({ amount: 9000.32 }); // '$9,000.32'\nformatUSD({ amount: 1.25889349857 }); // '$1.26'\nformatUSD({ amount: 1.25889349857, decimalPlaces: 0 }); // '$1'\nformatUSD({ amount: 1.25889349857, decimalPlaces: 3 }); // '$1.259'\n```\n\n## Contributing\n\nPlease read the [Contributing guidelines](CONTRIBUTING.md).\n\n### Running Tests\n\nWe are using [nodeunit](https://github.com/caolan/nodeunit) to test. To run tests, first install nodeunit and any dependencies via npm:\n\n```\nnpm install\n```\n\nRun tests with:\n\n```\nnpm test\n```\n\n## License\n\nThe project is in the public domain within the United States, and\ncopyright and related rights in the work worldwide are waived through\nthe [CC0 1.0 Universal public domain dedication](http://creativecommons.org/publicdomain/zero/1.0/).\n\nAll contributions to this project will be released under the CC0\ndedication. By submitting a pull request, you are agreeing to comply\nwith this waiver of copyright interest.\n\nSoftware source code previously released under an open source license and then modified by CFPB staff is considered a \"joint work\" (see 17 USC § 101); it is partially copyrighted, partially public domain, and as a whole is protected by the copyrights of the non-government authors and must be released according to the terms of the original open-source license.\n\nFor further details, please see: http://www.consumerfinance.gov/developers/sourcecodepolicy/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfpb%2Fformat-usd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcfpb%2Fformat-usd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfpb%2Fformat-usd/lists"}