• Version 2.0.5
  • Published
  • 6.93 kB
  • No dependencies
  • MIT license


npm i @types/numeral
yarn add @types/numeral
pnpm add @types/numeral


TypeScript definitions for numeral



variable fn

const fn: Numeral;

    variable formats

    const formats: NumeralJSFormats;
    • Object with all loaded formats

    variable locales

    const locales: NumeralJSLocales;
    • Object with all loaded locales

    variable options

    const options: NumeralJSOptions;

      variable version

      const version: string;


        function defaultFormat

        defaultFormat: (format: string) => void;

          function isNumeral

          isNumeral: (value: any) => boolean;
          • compare numeral object

          function locale

          locale: (key?: string) => string;
          • This function sets the current locale. If no arguments are passed in, it will simply return the current global locale key.

          function localeData

          localeData: (key?: string) => NumeralJSLocale;
          • This function provides access to the loaded locale data. If no arguments are passed in, it will simply return the current global locale object.

            Parameter key

            Locale key, e.g 'es' for a spanish locale definition

          function nullFormat

          nullFormat: (format: string) => void;

            function numeral

            numeral: typeof numeral;
            • A javascript library for formatting and manipulating numbers.

            function register

            register: (
            what: RegisterType,
            key: string,
            value: NumeralJSLocale | NumeralJSFormat
            ) => NumeralJSLocale | NumeralJSFormat;
            • Registers a language definition or a custom format definition.

              Parameter what

              Allowed values are: either 'format' or 'locale'

              Parameter key

              The key of the registerd type, e.g. 'de' for a german locale definition

              Parameter value

              The locale definition or the format definitiion

            function reset

            reset: () => void;
            • This function resets the configuration to all the defaults

            function validate

            validate: (value: any, culture: any) => boolean;

              function zeroFormat

              zeroFormat: (format: string) => void;


                class Numeral

                class Numeral {}


                  constructor(input: any, value: number);

                    property prototype

                    prototype: Numeral;

                      method add

                      add: (value: any) => Numeral;

                        method clone

                        clone: () => Numeral;

                          method difference

                          difference: (value: any) => number;

                            method divide

                            divide: (value: any) => Numeral;

                              method format

                              format: (inputString?: string, roundingFunction?: RoundingFunction) => string;

                                method input

                                input: () => any;

                                  method multiply

                                  multiply: (value: any) => Numeral;

                                    method set

                                    set: (value: any) => Numeral;

                                      method subtract

                                      subtract: (value: any) => Numeral;

                                        method value

                                        value: () => number | null;


                                          interface NumeralJSFormat

                                          interface NumeralJSFormat {}

                                            property format

                                            format: (
                                            value: any,
                                            format: string,
                                            roundingFunction: RoundingFunction
                                            ) => string;

                                              property regexps

                                              regexps: {
                                              format: RegExp;
                                              unformat: RegExp;

                                                property unformat

                                                unformat: (value: string) => number;

                                                  interface NumeralJSFormats

                                                  interface NumeralJSFormats {}

                                                    index signature

                                                    [id: string]: NumeralJSFormat;

                                                      interface NumeralJSLocale

                                                      interface NumeralJSLocale {}

                                                        property abbreviations

                                                        abbreviations: {
                                                        thousand: string;
                                                        million: string;
                                                        billion: string;
                                                        trillion: string;

                                                          property currency

                                                          currency: {
                                                          symbol: string;

                                                            property delimiters

                                                            delimiters: {
                                                            thousands: string;
                                                            decimal: string;

                                                              method ordinal

                                                              ordinal: (num: number) => string;

                                                                interface NumeralJSLocales

                                                                interface NumeralJSLocales {}

                                                                  index signature

                                                                  [id: string]: NumeralJSLocale;

                                                                    interface NumeralJSOptions

                                                                    interface NumeralJSOptions {}

                                                                      property currentLocale

                                                                      currentLocale: string;

                                                                        property defaultFormat

                                                                        defaultFormat: string;

                                                                          property nullFormat

                                                                          nullFormat: string;

                                                                            property scalePercentBy100

                                                                            scalePercentBy100: boolean;

                                                                              property zeroFormat

                                                                              zeroFormat: string;

                                                                                interface NumeralJSUtils

                                                                                interface NumeralJSUtils {}

                                                                                  property numberToFormat

                                                                                  numberToFormat: (
                                                                                  value: number,
                                                                                  format: string,
                                                                                  roundingFunction?: RoundingFunction
                                                                                  ) => string;

                                                                                    property stringToNumber

                                                                                    stringToNumber: (string: string) => number;

                                                                                      Type Aliases

                                                                                      type RegisterType

                                                                                      type RegisterType = 'format' | 'locale';

                                                                                        type RoundingFunction

                                                                                        type RoundingFunction = (value: number) => number;

                                                                                          Package Files (1)

                                                                                          Dependencies (0)

                                                                                          No dependencies.

                                                                                          Dev Dependencies (0)

                                                                                          No dev dependencies.

                                                                                          Peer Dependencies (0)

                                                                                          No peer dependencies.


                                                                                          To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                          You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/numeral.

                                                                                          • Markdown
                                                                                          • HTML
                                                                                            <a href="https://www.jsdocs.io/package/@types/numeral"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>