Numeral.js - add missing second optional argument to format method for rounding function

This commit is contained in:
Brendan McKeown
2017-06-07 09:25:29 -04:00
parent 15e9249275
commit 1e85e1d7fb
2 changed files with 6 additions and 1 deletions
+3 -1
View File
@@ -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;
+3
View File
@@ -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