SheetXL - v0.3.20
    Preparing search index...
    • Counts the number of decimal places in a numeric string.

      Parameters

      • input: string

        The string representation of a number.

      Returns number

      The number of decimal places. Returns 0 if there are no decimal places.

      countDecimals('123.456'); // Returns 3
      countDecimals('123'); // Returns 0