Function normalizePrice

  • Normalizes a price value based on the provided decimals and direction.

    Parameters

    • price: number

      The price value to normalize.

    • decimals: number

      The number of decimals to consider for normalization.

    • direction: PriceNormalizationType = PriceNormalizationType.RAW

      The direction of normalization. RAW = multiply by decimals, PRETTY = divide by decimals.

    • Optionalprecision: number

      The precision to use when rounding the result. If not provided, the result is floored.

    Returns number

    • The normalized price.