@ruchernchong/number-format
v2.3.3
Published
Package to convert huge numbers to their respective named values in thousands separator
Downloads
512
Readme
number-format
Convert large numbers to their respective readable named values using thousands as the separator
Installation
pnpm add @ruchernchong/number-format
Usage
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:
import { numberFormat } from "@ruchernchong/number-format";
const value: string = numberFormat(1000000); // 1M
Testing
pnpm test
License
This project is licensed under the MIT License - see the LICENSE file for details.
Changelog
See CHANGELOG.md for a list of changes.
Support
- Create an issue
- Email: [email protected]
- Twitter: @ruchernchong