Utilities
Digits
Convert numbers between English and Bangla digits without changing the surrounding text.
Start Here
Use digit helpers when you want to change the numeral system without changing the rest of the text.
Quick Rule
If only the digits should change, use toBanglaDigits() or toEnglishDigits().
Common Uses
| Situation | Helper |
|---|---|
| Show Bangla digits in a sentence | toBanglaDigits() |
| Convert Bangla digits back to English | toEnglishDigits() |
| Keep month names or words unchanged | Use digit helpers instead of full date formatting |
Example
import { toBanglaDigits, toEnglishDigits } from "@coreify/tarikh";
toBanglaDigits("31 March 2026");
// -> "৩১ March ২০২৬"
toEnglishDigits("৩১ মার্চ ২০২৬");
// -> "31 March 2026"Good Fit
This is useful for names, labels, counters, and mixed-language text where only the digits need to change.