SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Function countDecimals

    • 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