mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 23:10:29 +00:00
Numeral.js - add missing second optional argument to format method for rounding function
This commit is contained in:
Vendored
+3
-1
@@ -35,6 +35,8 @@ interface NumeralJsFormat {
|
||||
|
||||
type RegisterType = 'format' | 'locale';
|
||||
|
||||
type RoundingFunction = (value: number) => number;
|
||||
|
||||
// http://numeraljs.com/#use-it
|
||||
interface Numeral {
|
||||
(value?: any): Numeral;
|
||||
@@ -60,7 +62,7 @@ interface Numeral {
|
||||
nullFormat(format: string): void;
|
||||
defaultFormat(format: string): void;
|
||||
clone(): Numeral;
|
||||
format(inputString?: string): string;
|
||||
format(inputString?: string, roundingFunction?: RoundingFunction): string;
|
||||
formatCurrency(inputString?: string): string;
|
||||
unformat(inputString: string): number;
|
||||
value(): number;
|
||||
|
||||
@@ -6,6 +6,9 @@ var valueFormat: string = numeral(1000).format('0,0');
|
||||
var valueUnformat: number = numeral().unformat('($10,000.00)');
|
||||
// '-10000'
|
||||
|
||||
var valueFormatFloor: string = numeral(1.357).format('0.00', Math.floor);
|
||||
// '1.35'
|
||||
|
||||
var value3: Numeral = numeral(1000);
|
||||
var added: Numeral = value3.add(10);
|
||||
// 1010
|
||||
|
||||
Reference in New Issue
Block a user