From 03c5816cc64847b9db44f679542d8472b5c597ac Mon Sep 17 00:00:00 2001 From: Satakun Utama Date: Wed, 4 Nov 2026 19:27:04 +0700 Subject: [PATCH 1/2] Add Thai numbering --- src/numeral_systems.rs | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/numeral_systems.rs b/src/numeral_systems.rs index 10e41c5..6e394ac 100644 --- a/src/numeral_systems.rs +++ b/src/numeral_systems.rs @@ -514,6 +514,29 @@ declare_named! { /// /// > *, †, ‡, §, ¶, ‖, **, ††, ‡‡, §§, ¶¶, ‖‖, ***, ††† Symbols = "symbol" ("*"), + + /// Decimal positional notation using + /// [Thai numerals](https://en.wikipedia.org/wiki/Thai_numerals) + /// + /// ## Representable Numbers + /// All non-negative integers can be represented + /// + /// ## Example + /// + /// The first twelve non-negative integers are represented as follows: + /// > ๐, ๑, ๒, ๓, ๔, ๕, ๖, ๗, ๘, ๙, ๑๐, ๑๑ + Thai = "thai" ("๑"), + + /// Thai letters + /// + /// ## Representable Numbers + /// Positive integers up to and including 41 (1—41, Excluding ฃ, ฅ, and ฆ) + /// + /// ## Example + /// + /// The first twelve positive integers are represented as follows: + /// > ก, ข, ค, ง, จ, ฉ, ช, ซ, ณ, ญ, ฎ, ฏ + ThaiLetters = "thai.letter" ("ก"), } } @@ -868,6 +891,16 @@ impl NamedNumeralSystem { ]), Self::Symbols => NumeralSystem::Symbolic(&["*", "†", "‡", "§", "¶", "‖"]), + + Self::Thai => NumeralSystem::Positional(&[ + "๐", "๑", "๒", "๓", "๔", "๕", "๖", "๗", "๘", "๙", + ]), + + Self::ThaiLetters => NumeralSystem::Fixed(&[ + "ก", "ข", "ค", "ง", "จ", "ฉ", "ช", "ซ", "ฌ", "ญ", "ฎ", "ฏ", "ฐ", "ฑ", + "ฒ", "ณ", "ด", "ต", "ถ", "ท", "ธ", "น", "บ", "ป", "ผ", "ฝ", "พ", "ฟ", + "ภ", "ม", "ย", "ร", "ล", "ว", "ศ", "ษ", "ส", "ห", "ล", "อ", "ฮ", + ]), } } } From 9ed47daf4a10e309f9210350b371b8c88cef5399 Mon Sep 17 00:00:00 2001 From: Satakun Utama Date: Wed, 18 Nov 2026 22:44:45 +0700 Subject: [PATCH 2/2] Adjust test_numeral_systems, Change ThaiLetters to ZerolessFixed --- src/numeral_systems.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/numeral_systems.rs b/src/numeral_systems.rs index 6e394ac..6f3652f 100644 --- a/src/numeral_systems.rs +++ b/src/numeral_systems.rs @@ -896,7 +896,7 @@ impl NamedNumeralSystem { "๐", "๑", "๒", "๓", "๔", "๕", "๖", "๗", "๘", "๙", ]), - Self::ThaiLetters => NumeralSystem::Fixed(&[ + Self::ThaiLetters => NumeralSystem::ZerolessFixed(&[ "ก", "ข", "ค", "ง", "จ", "ฉ", "ช", "ซ", "ฌ", "ญ", "ฎ", "ฏ", "ฐ", "ฑ", "ฒ", "ณ", "ด", "ต", "ถ", "ท", "ธ", "น", "บ", "ป", "ผ", "ฝ", "พ", "ฟ", "ภ", "ม", "ย", "ร", "ล", "ว", "ศ", "ษ", "ส", "ห", "ล", "อ", "ฮ", @@ -1498,6 +1498,8 @@ mod tests { NamedNumeralSystem::Bengali => 79096832028418218544110224478554962928, NamedNumeralSystem::BengaliLetters => 269999388716378396079918080520770981179, NamedNumeralSystem::Symbols => 88780534058354093087932015985325954737, + NamedNumeralSystem::Thai => 24629330179757431545706612668883071968, + NamedNumeralSystem::ThaiLetters => 11411336741365137317186217842643707911, } }