{"id":15690910,"url":"https://github.com/bubkoo/number-abbreviate","last_synced_at":"2025-05-07T23:45:54.717Z","repository":{"id":56788251,"uuid":"113885935","full_name":"bubkoo/number-abbreviate","owner":"bubkoo","description":"🎱 Abbreviate number to a more human-friendly format (3.6K, 6.8M, etc.)","archived":false,"fork":false,"pushed_at":"2022-12-16T08:19:58.000Z","size":161,"stargazers_count":9,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-07T23:45:34.727Z","etag":null,"topics":["abbr","abbreviate","format","human-friendly","number","units"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/bubkoo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-11T17:04:37.000Z","updated_at":"2024-10-28T15:56:49.000Z","dependencies_parsed_at":"2023-01-29T11:47:20.172Z","dependency_job_id":null,"html_url":"https://github.com/bubkoo/number-abbreviate","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/bubkoo%2Fnumber-abbreviate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bubkoo%2Fnumber-abbreviate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bubkoo%2Fnumber-abbreviate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bubkoo%2Fnumber-abbreviate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bubkoo","download_url":"https://codeload.github.com/bubkoo/number-abbreviate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252973618,"owners_count":21834105,"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":["abbr","abbreviate","format","human-friendly","number","units"],"created_at":"2024-10-03T18:17:20.222Z","updated_at":"2025-05-07T23:45:54.676Z","avatar_url":"https://github.com/bubkoo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eAbbreviate Number\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\u003cstrong\u003eAbbreviate number to a more human-friendly format (3.6K, 6.8M, etc.)\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/bubkoo/number-abbreviate?style=flat-square\" alt=\"MIT License\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.typescriptlang.org\"\u003e\u003cimg alt=\"Language\" src=\"https://img.shields.io/badge/language-TypeScript-blue.svg?style=flat-square\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/bubkoo/number-abbreviate/pulls\"\u003e\u003cimg alt=\"PRs Welcome\" src=\"https://img.shields.io/badge/PRs-Welcome-brightgreen.svg?style=flat-square\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/bubkoo/number-abbreviate/actions/workflows/ci.yml\"\u003e\u003cimg alt=\"build\" src=\"https://img.shields.io/github/actions/workflow/status/bubkoo/number-abbreviate/ci.yml?branch=master\u0026logo=github\u0026style=flat-square\"\u003e\u003c/a\u003e\n\u003ca href=\"https://app.codecov.io/gh/bubkoo/number-abbreviate\"\u003e\u003cimg alt=\"coverage\" src=\"https://img.shields.io/codecov/c/gh/bubkoo/number-abbreviate?logo=codecov\u0026style=flat-square\u0026token=BWweeU2uNX\"\u003e\u003c/a\u003e\n\u003ca href=\"https://lgtm.com/projects/g/bubkoo/number-abbreviate/context:javascript\" rel=\"nofollow\"\u003e\u003cimg alt=\"Language grade: JavaScript\" src=\"https://img.shields.io/lgtm/grade/javascript/g/bubkoo/number-abbreviate.svg?logo=lgtm\u0026style=flat-square\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://www.npmjs.com/package/numabbr\" rel=\"nofollow\"\u003e\u003cimg alt=\"NPM Package\" src=\"https://img.shields.io/npm/v/numabbr.svg?style=flat-square\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://www.npmjs.com/package/numabbr\" rel=\"nofollow\"\u003e\u003cimg alt=\"NPM Downloads\" src=\"http://img.shields.io/npm/dm/numabbr.svg?style=flat-square\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Install\n\n```\nnpm install numabbr --save\n```\n\n## Usage\n\nSimple/shorthand mode:\n\n```js\nimport numabbr from 'numabbr'\n\nnumabbr(100)           // =\u003e 100\nnumabbr(10000)         // =\u003e 10K\nnumabbr(-10000)        // =\u003e -10K\nnumabbr(1000000)       // =\u003e 1M\nnumabbr(1020000)       // =\u003e 1.02M\nnumabbr(1000000000)    // =\u003e 1B\nnumabbr(1000000000000) // =\u003e 1T\n\nnumabbr(123456, { precision: 1 }) // =\u003e 123.5K\n\nnumabbr(123456, {\n      precision: 1,\n      commatize: { division: 2 },\n}) // =\u003e 1,23.5K\n```\n\nClass/constructor mode:\n\n```js\nimport { NumberAbbreviate } from 'numabbr'\nconst abbr = new NumberAbbreviate({\n  千: 1000,\n  万: 10000,\n  十万: 100000,\n  百万: 1000000,\n  千万: 10000000,\n  亿: 100000000,\n})\n\nabbr.abbreviate(123)    // =\u003e 123\nabbr.abbreviate(1000)   // =\u003e 1千\nabbr.abbreviate(1234)   // =\u003e 1.23千\nabbr.abbreviate(10000)  // =\u003e 1万\nabbr.abbreviate(12345)  // =\u003e 1.23万\nabbr.abbreviate(123456) // =\u003e 1.23十万\n```\n\n## Options\n\n- **precision** { Number } Default `2`. Specify the precision of decimal part\n- **commatize** { Object | Boolean } Default `false`. Specify how to commatize the result\n  - **division** { Number } Default `3`. Length of each divided parts\n  - **separator** { Char } Default `,`. Separator of each divided parts\n\n## Contributing\n\nPull requests and stars are highly welcome.\n\nFor bugs and feature requests, please [create an issue](https://github.com/bubkoo/number-abbreviate/issues/new).\n\n\n## License\n\nThe scripts and documentation in this project are released under the [MIT License](LICENSE)\ns\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbubkoo%2Fnumber-abbreviate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbubkoo%2Fnumber-abbreviate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbubkoo%2Fnumber-abbreviate/lists"}