@leanchuck/core - v0.1.1
    Preparing search index...

    Function toPercentString

    • Formats a ratio (0–1 scale) as a human-readable percent string.

      Parameters

      • value: number

        A ratio, typically between 0 and 1.

      • places: number = 1

        Decimal places to keep in the output. Defaults to 1.

      Returns string

      A string such as "25.3%".

      toPercentString(0.2525);    // "25.3%"
      toPercentString(0.2525, 2); // "25.25%"