PHP WebShell

Текущая директория: /usr/lib/node_modules/bitgo/node_modules/micro-eth-signer/lib

Просмотр файла: formatters.d.ts

export declare function parseDecimal(s: string, precision: number): bigint;
export declare function formatDecimal(n: bigint, precision: number): string;
export declare function perCentDecimal(precision: number, price: number): bigint;
/**
 * Reduces decimal precision. We can't just round to some arbitrary value like 0.01.
 * People care mostly about 2-3 most significant digits:
 *   - 123 456 -> 123 000
 *   - 12 345 -> 12 300
 *   - 2.5678 -> 2.56
 *   - 143.43 -> 143.00
 *   - 15.43 -> 15.40
 *
 * Anything with value of less than 0.01 is not important: 0.001 == 0.00, even if these are
 * 2-3 most significant digits. Should we round non-significant digits such as 123.90 -> 124.00,
 * 123.40 -> 123.00? It's OK for displaying total balance of an account: we use 2-3 significant
 * digits. It's NOT OK for creating txs with the amount, you can't do 2.00 tx if you have 1.99.
 * @example
 *   roundDecimal(699999n, 5), 699990n
 */
export declare function roundDecimal(n: bigint, roundPrecision: number, precision?: number, price?: number): bigint;
export declare function fromWei(wei: string | number | bigint): string;
export declare function formatUSD(amount: number): string;
//# sourceMappingURL=formatters.d.ts.map

Выполнить команду


Для локальной разработки. Не используйте в интернете!