ethers.js/packages/bignumber/fixednumber.d.ts

36 lines
1.7 KiB
TypeScript
Raw Normal View History

2019-05-15 01:48:48 +03:00
import { BytesLike } from "@ethersproject/bytes";
import { BigNumber, BigNumberish } from "./bignumber";
export declare function formatFixed(value: BigNumberish, decimals?: string | BigNumberish): string;
export declare function parseFixed(value: string, decimals?: BigNumberish): BigNumber;
export declare class FixedFormat {
readonly signed: boolean;
readonly width: number;
readonly decimals: number;
readonly name: string;
2019-06-12 00:57:04 +03:00
readonly _multiplier: string;
2019-05-15 01:48:48 +03:00
constructor(constructorGuard: any, signed: boolean, width: number, decimals: number);
static from(value: any): FixedFormat;
}
export declare class FixedNumber {
readonly format: FixedFormat;
readonly _hex: string;
readonly _value: string;
2019-06-12 00:57:04 +03:00
readonly _isFixedNumber: boolean;
2019-05-15 01:48:48 +03:00
constructor(constructorGuard: any, hex: string, value: string, format?: FixedFormat);
_checkFormat(other: FixedNumber): void;
addUnsafe(other: FixedNumber): FixedNumber;
subUnsafe(other: FixedNumber): FixedNumber;
mulUnsafe(other: FixedNumber): FixedNumber;
divUnsafe(other: FixedNumber): FixedNumber;
round(decimals?: number): FixedNumber;
toString(): string;
toHexString(width?: number): string;
toUnsafeFloat(): number;
toFormat(format: FixedFormat | string): FixedNumber;
static fromValue(value: BigNumber, decimals?: BigNumberish, format?: FixedFormat | string): FixedNumber;
static fromString(value: string, format?: FixedFormat | string): FixedNumber;
static fromBytes(value: BytesLike, format?: FixedFormat | string): FixedNumber;
static from(value: any, format?: FixedFormat | string): FixedNumber;
static isFixedNumber(value: any): value is FixedNumber;
}