@hebcal/hdate
Version:
converts between Hebrew and Gregorian dates using Rata Die (R.D.) algorithm by Dershowitz and Reingold
26 lines (25 loc) • 931 B
TypeScript
/**
* Converts a numerical value to a string of Hebrew letters.
*
* When specifying years of the Hebrew calendar in the present millennium,
* we omit the thousands (which is presently 5 [ה]).
* @example
* gematriya(5774) // 'תשע״ד' - cropped to 774
* gematriya(25) // 'כ״ה'
* gematriya(60) // 'ס׳'
* gematriya(3761) // 'ג׳תשס״א'
* gematriya(1123) // 'א׳קכ״ג'
*/
export declare function gematriya(num: number | string): string;
/**
* Converts a string of Hebrew letters to a numerical value.
*
* Only considers the value of Hebrew letters `א` through `ת`.
* Ignores final Hebrew letters such as `ך` (kaf sofit) or `ם` (mem sofit)
* and vowels (nekudot).
* @example
* gematriyaStrToNum('תשע״ד'); // 774
* gematriyaStrToNum('ט״ו'); // 15
* gematriyaStrToNum('ג׳תשס״א'); // 3761 (thousands prefix)
*/
export declare function gematriyaStrToNum(str: string): number;