UNPKG

@vansite/ts-sharetribe-flex-sdk

Version:

This is a TypeScript SDK for Sharetribe Flex API. It reduces the complexity of the API and provides a more user-friendly interface.

31 lines (30 loc) 1.06 kB
/** * Class representing a high-precision decimal number. * * The BigDecimal class ensures that large decimal numbers are stored as strings * to avoid precision loss during computations. */ import { SdkType } from "../types"; declare const BIGDECIMAL_SDK_TYPE = "BigDecimal"; declare class BigDecimal implements SdkType { value: string; readonly _sdkType: typeof BIGDECIMAL_SDK_TYPE; /** * Creates an instance of the BigDecimal class. * * @param {any} value - The value to be stored as a BigDecimal. It must be convertible to a string. * @example * const bigDecimal = new BigDecimal('123456789.123456789'); */ constructor(value: any); /** * Converts the BigDecimal instance to a string representation. * * @returns {string} - The string representation of the BigDecimal. * @example * const bigDecimal = new BigDecimal('123456789.123456789'); * console.log(bigDecimal.toString()); // Outputs: '123456789.123456789' */ toString(): string; } export default BigDecimal;