### Install Millify via npm Source: https://github.com/izolate/millify/blob/main/README.md Install the Millify package using npm. This command is used to add the library to your project's dependencies. ```bash npm install millify ``` -------------------------------- ### Millify with Custom Locales Source: https://github.com/izolate/millify/blob/main/README.md Format numbers according to specific language and regional conventions using the `locales` option. This example uses German formatting. ```javascript millify(39500, { precision: 2, locales: "de-DE" }); // 3,95K ``` -------------------------------- ### Millify with Custom Units and Space Source: https://github.com/izolate/millify/blob/main/README.md Customize the unit abbreviations and add a space between the number and the unit. This example uses custom units and enables spacing. ```javascript millify(1440000, { units: ["B", "KB", "MB", "GB", "TB"], space: true, }); // 1.44 MB ``` -------------------------------- ### Millify Command Line Usage Source: https://github.com/izolate/millify/blob/main/README.md Execute millify directly from the command line to convert a number. Use `millify --help` for a list of available options. ```bash $ millify 12345 12.3K ``` -------------------------------- ### Basic Programmatic Usage of Millify Source: https://github.com/izolate/millify/blob/main/README.md Import and use the millify function to convert a number to a human-readable string. For CommonJS environments, use `require`. ```javascript import millify from "millify"; // For CommonJS: `const { millify } = require("millify");` millify(2500); // 2.5K ``` -------------------------------- ### millify(value: number, options: MillifyOptions) Source: https://github.com/izolate/millify/blob/main/README.md Converts a given number into a human-readable string format. Supports customization through options like precision, locales, case, spacing, and units. ```APIDOC ## millify(value: number, options: MillifyOptions) ### Description Converts a number into a human-readable string. ### Parameters #### Path Parameters - **value** (number) - Required - The number to convert. - **options** (MillifyOptions) - Optional - Configuration object for formatting. ### Options - **precision** (number) - Optional - Default: `1`. Number of decimal places to use. - **locales** (string | Array) - Optional - Default: browser language. Formats the number in different languages. - **lowercase** (boolean) - Optional - Default: `false`. Use lowercase abbreviations. - **space** (boolean) - Optional - Default: `false`. Add a space between number and abbreviation. - **units** (Array) - Optional - Default: `['', 'K', 'M', 'B', 'T', 'P', 'E']`. Unit abbreviations to use. ### Request Example ```javascript import millify from "millify"; // For CommonJS: `const { millify } = require("millify");` millify(2500); // Returns "2.5K" millify(1024000, { precision: 3, lowercase: true }); // Returns "1.024m" millify(39500, { precision: 2, locales: "de-DE" }); // Returns "3,95K" millify(1440000, { units: ["B", "KB", "MB", "GB", "TB"], space: true, }); // Returns "1.44 MB" ``` ### Response #### Success Response (string) - Returns the formatted number as a string. ``` -------------------------------- ### Millify with Custom Precision and Lowercase Source: https://github.com/izolate/millify/blob/main/README.md Configure millify to use a specific number of decimal places and lowercase abbreviations. This is useful for consistent formatting. ```javascript millify(1024000, { precision: 3, lowercase: true }); // 1.024m ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.