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

40 lines
1.8 KiB
TypeScript
Raw Permalink Normal View History

2019-05-14 18:48:48 -04: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-11 17:57:04 -04:00
readonly _multiplier: string;
2019-05-14 18:48:48 -04: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-11 17:57:04 -04:00
readonly _isFixedNumber: boolean;
2019-05-14 18:48:48 -04: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;
2020-09-11 02:10:58 -04:00
floor(): FixedNumber;
ceiling(): FixedNumber;
2019-05-14 18:48:48 -04:00
round(decimals?: number): FixedNumber;
2020-06-29 00:54:30 -04:00
isZero(): boolean;
2020-09-11 02:10:58 -04:00
isNegative(): boolean;
2019-05-14 18:48:48 -04:00
toString(): string;
toHexString(width?: number): string;
toUnsafeFloat(): number;
toFormat(format: FixedFormat | string): FixedNumber;
2021-05-17 16:19:36 -04:00
static fromValue(value: BigNumber, decimals?: BigNumberish, format?: FixedFormat | string | number): FixedNumber;
static fromString(value: string, format?: FixedFormat | string | number): FixedNumber;
static fromBytes(value: BytesLike, format?: FixedFormat | string | number): FixedNumber;
static from(value: any, format?: FixedFormat | string | number): FixedNumber;
2019-05-14 18:48:48 -04:00
static isFixedNumber(value: any): value is FixedNumber;
}
//# sourceMappingURL=fixednumber.d.ts.map