Make your count Elegant
Tiny javascript library to format numbers in a pretty human readable format
Standard
1 million
Indian
10 lakh
East Asian
100 万

#Usage

Install Package

npm i pretty-count

    Import utitlity

    import pc from 'pretty-count';

      Use the utility

      pc(1000000) // 1million
      pc(1000000000, {
      scale: "indian",
      showFullSymbol: false
      }) //1Ar

        #Options

        PropertyTypeDescriptionDefault
        scaleScaleTypeSpecifies the scale type to use."indian"
        customScaleScaleValue[]An array of custom scale values to use instead of the predefined scales.null
        prefixstringA string to prepend to the formatted number.""
        suffixstringA string to append to the formatted number.""
        roundingMethod"round" | "floor" | "ceil"The method to use for rounding the number.null
        seperatorstringThe separator to use between number groups (e.g., thousands separator)." "
        showFullSymbolbooleanWhether to show the full symbol or use the short version.true
        decimalPlacesnumberThe number of decimal places to display in the formatted number.2

        Types

        #Scale Value

        export type ScaleValue = {
        value: number;
        shortSymbol?: string;
        symbol: string;
        };

          #Scale Type

          export type ScaleType = "standard" | "indian" | "eastAsian"