@types/numeral
- Version 2.0.5
- Published
- 6.93 kB
- No dependencies
- MIT license
Install
npm i @types/numeral
yarn add @types/numeral
pnpm add @types/numeral
Overview
TypeScript definitions for numeral
Index
Variables
Functions
Classes
Interfaces
Type Aliases
Variables
Functions
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;
Classes
class Numeral
class Numeral {}
constructor
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;
Interfaces
interface NumeralJSFormat
interface NumeralJSFormat {}
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.
Badge
To add a badge like this oneto 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[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/numeral)
- 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>
- Updated .
Package analyzed in 1307 ms. - Missing or incorrect documentation? Open an issue for this package.