mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Merge pull request #17331 from chrisleck/accounting-format-money-type-fix
Update accounting.formatMoney definition to allow string input
This commit is contained in:
@@ -3,6 +3,9 @@
|
||||
// Default usage:
|
||||
accounting.formatMoney(12345678); // $12,345,678.00
|
||||
|
||||
// Stringified usage:
|
||||
accounting.formatMoney('$4394958309392.9401'); // $4,394,958,309,392.94
|
||||
|
||||
// European formatting (custom symbol and separators), could also use options object as second param:
|
||||
accounting.formatMoney(4999.99, "€", 2, ".", ","); // €4.999,99
|
||||
|
||||
|
||||
Vendored
+6
-5
@@ -1,6 +1,7 @@
|
||||
// Type definitions for accounting.js 0.3
|
||||
// Project: http://josscrowcroft.github.io/accounting.js/
|
||||
// Type definitions for accounting.js 0.4
|
||||
// Project: http://openexchangerates.github.io/accounting.js/
|
||||
// Definitions by: Sergey Gerasimov <https://github.com/gerich-home/>
|
||||
// Christopher Eck <https://github.com/chrisleck/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace accounting {
|
||||
@@ -30,9 +31,9 @@ declare namespace accounting {
|
||||
}
|
||||
|
||||
interface Static {
|
||||
// format any number into currency
|
||||
formatMoney(number: number, symbol?: string, precision?: number, thousand?: string, decimal?: string, format?: string): string;
|
||||
formatMoney(number: number, options: CurrencySettings<string> | CurrencySettings<CurrencyFormat>): string;
|
||||
// format any number or stringified number into currency
|
||||
formatMoney(number: number | string, symbol?: string, precision?: number, thousand?: string, decimal?: string, format?: string): string;
|
||||
formatMoney(number: number | string, options: CurrencySettings<string> | CurrencySettings<CurrencyFormat>): string;
|
||||
|
||||
formatMoney(numbers: number[], symbol?: string, precision?: number, thousand?: string, decimal?: string, format?: string): string[];
|
||||
formatMoney(numbers: number[], options: CurrencySettings<string> | CurrencySettings<CurrencyFormat>): string[];
|
||||
|
||||
Reference in New Issue
Block a user