blob: 9552129071ba9adf4bd73949c1728832fd50dc6a [file] [log] [blame]
// generated by diplomat-tool
import type { FixedDecimalLimitError } from "./FixedDecimalLimitError"
import type { FixedDecimalParseError } from "./FixedDecimalParseError"
import type { FixedDecimalRoundingIncrement } from "./FixedDecimalRoundingIncrement"
import type { FixedDecimalSign } from "./FixedDecimalSign"
import type { FixedDecimalSignDisplay } from "./FixedDecimalSignDisplay"
import type { FixedDecimalSignedRoundingMode } from "./FixedDecimalSignedRoundingMode"
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
/** See the [Rust documentation for `FixedDecimal`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html) for more information.
*/
export class Decimal {
get ffiValue(): pointer;
static fromNumber(v: number): Decimal;
static fromBigInt(v: bigint): Decimal;
static fromNumberWithLowerMagnitude(f: number, magnitude: number): Decimal;
static fromNumberWithSignificantDigits(f: number, digits: number): Decimal;
static fromNumberWithRoundTripPrecision(f: number): Decimal;
static fromString(v: string): Decimal;
digitAt(magnitude: number): number;
get magnitudeStart(): number;
get magnitudeEnd(): number;
get nonzeroMagnitudeStart(): number;
get nonzeroMagnitudeEnd(): number;
get isZero(): boolean;
multiplyPow10(power: number): void;
get sign(): FixedDecimalSign;
set sign(sign: FixedDecimalSign);
applySignDisplay(signDisplay: FixedDecimalSignDisplay): void;
trimStart(): void;
trimEnd(): void;
trimEndIfInteger(): void;
padStart(position: number): void;
padEnd(position: number): void;
setMaxPosition(position: number): void;
round(position: number): void;
ceil(position: number): void;
expand(position: number): void;
floor(position: number): void;
trunc(position: number): void;
roundWithMode(position: number, mode: FixedDecimalSignedRoundingMode): void;
roundWithModeAndIncrement(position: number, mode: FixedDecimalSignedRoundingMode, increment: FixedDecimalRoundingIncrement): void;
concatenateEnd(other: Decimal): boolean;
toString(): string;
}