toHebrewNumeral

fun Int.toHebrewNumeral(includeGeresh: Boolean = true): String

Converts an integer to its corresponding Hebrew numeral representation (Gematria).

This function converts the integer to a string of Hebrew letters. It handles years in the Hebrew calendar within the current millennium, omitting the thousands digit if necessary. The function can include or exclude the GERESH and GERSHAYIM symbols based on the includeGeresh parameter.

Receiver

Int The numerical value to convert. It must be a non-negative integer.

Return

A string representing the Hebrew numeral (Gematria) equivalent of the integer. The result may include or exclude the GERESH and GERSHAYIM symbols based on the includeGeresh parameter.

Parameters

includeGeresh

A Boolean flag that determines whether to include the GERESH (׳) and GERSHAYIM (״) symbols in the output. Default is true, meaning these symbols will be included.

Throws

IllegalArgumentException

If the integer is negative.

Samples