@hebcal/core
    Preparing search index...

    Function gematriyaStrToNum

    • Converts a string of Hebrew letters to a numerical value.

      Considers the value of Hebrew letters א through ת, and the five final (sofit) forms ך, ם, ן, ף, ץ, which count as their base letters (20, 40, 50, 80, 90). This matches how Hebrew years are written — e.g. תש״ף is 780 — since the last letter of a year falls in final form. Vowels (nekudot) are ignored.

      Parameters

      • str: string

      Returns number

      gematriyaStrToNum('תשע״ד');   // 774
      gematriyaStrToNum('תש״ף'); // 780 (final pe)
      gematriyaStrToNum('ט״ו'); // 15
      gematriyaStrToNum('ג׳תשס״א'); // 3761 (thousands prefix)