A npm package for abbreviating large numbers.
You can install the package via npm:
npm install num-abbr
const { useNumberAbbreviation } = require('num-abbr');
console.log(useNumberAbbreviation(1000)); // Output: "1k"
import { useNumberAbbreviation } from 'num-abbr';
console.log(useNumberAbbreviation(1000)); // Output: "1k"
useNumberAbbreviation(value: number): string
Abbreviates a large number into a more readable format.
-value
: The number to be abbreviated.
-Returns
: The abbreviated string representation of the number.