Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ruchernchong/number-format
Convert large numbers to their respective readable named values using thousands as the separator
https://github.com/ruchernchong/number-format
Last synced: about 10 hours ago
JSON representation
Convert large numbers to their respective readable named values using thousands as the separator
- Host: GitHub
- URL: https://github.com/ruchernchong/number-format
- Owner: ruchernchong
- License: mit
- Created: 2023-01-08T13:00:59.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-17T02:17:43.000Z (about 1 month ago)
- Last Synced: 2025-01-18T02:40:41.766Z (3 days ago)
- Language: TypeScript
- Homepage:
- Size: 523 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# number-format
[![npm version](https://img.shields.io/npm/v/@ruchernchong/number-format.svg)](https://www.npmjs.com/package/@ruchernchong/number-format)
[![npm downloads](https://img.shields.io/npm/dm/@ruchernchong/number-format.svg)](https://www.npmjs.com/package/@ruchernchong/number-format)
[![License](https://img.shields.io/npm/l/@ruchernchong/number-format.svg)](https://github.com/username/@ruchernchong/number-format/blob/main/LICENSE)Convert large numbers to their respective readable named values using thousands as the separator
## Installation
```bash
pnpm add @ruchernchong/number-format
```## Usage
```javascript
const numberFormat = require("@ruchernchong/number-format");
// or
import { numberFormat } from "@ruchernchong/number-format";// Basic example
numberFormat(1000); // 1k
```## TypeScript Support
This package includes TypeScript type definitions. Example usage with TypeScript:
```typescript
import { numberFormat } from "@ruchernchong/number-format";const value: string = numberFormat(1000000); // 1M
```## Testing
```bash
pnpm test
```## License
This project is licensed under the [MIT License](LICENSE) - see the LICENSE file for details.
## Changelog
See [CHANGELOG.md](CHANGELOG.md) for a list of changes.
## Support
- Create an [issue](https://github.com/ruchernchong/number-format/issues)
- Email: [[email protected]](mailto:[email protected])
- Twitter: [@ruchernchong](https://twitter.com/ruchernchong)