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: 4 months 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 (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-14T18:07:09.000Z (8 months ago)
- Last Synced: 2025-04-05T10:06:36.314Z (7 months ago)
- Language: TypeScript
- Homepage:
- Size: 595 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
[](https://www.npmjs.com/package/@ruchernchong/number-format)
[](https://www.npmjs.com/package/@ruchernchong/number-format)
[](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: [hello@ruchern.dev](mailto:hello@ruchern.dev)
- Twitter: [@ruchernchong](https://twitter.com/ruchernchong)