CCC Docs
    Preparing search index...

    Function fixedPointToString

    • Converts a FixedPointLike value to its string representation with fixed-point decimals.

      Parameters

      • val: FixedPointLike

        The value to convert, which can be a bigint, string, or number.

      • decimals: number = 8

        The number of decimal places for the fixed-point representation. Default is 8.

      Returns string

      A string representing the fixed-point value.

      const str = fixedPointToString(123456789n, 8); // Outputs "1.23456789"
      const strFromString = fixedPointToString("1.23456789", 8); // Outputs "1.23456789"
      const strFromNumber = fixedPointToString(1.23456789, 8); // Outputs "1.23456789"