Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#3374·Carbon

th locale: add Thai digits (alt_numbers)

Author: kamthornCreated Sep 30, 2026Updated Sep 30, 2026

The th locale has no alt_numbers, so the O-prefixed tokens (OD, OM, OY, OH, Om…), getAltNumber() and forHumans(['altNumbers' => true]) output Western digits. Thai has its own digits ๐–๙, which are still used in official documents.

php
Carbon::parse('2026-01-05 14:05')->locale('th')->isoFormat('OD MMMM OY OH:Om');
// now:      "5 มกราคม 2026 14:5"
// expected: "๐๕ มกราคม ๒๐๒๖ ๑๔:๐๕"

The proposal is a 100-entry zero-padded table (๐๐–๙๙), like ar_EG, my and fa, so times and short dates keep their padding. I have a PR ready for it.

Source: briannesbitt/Carbon

View original on GitHubView discussion on GitHub