UNPKG

to-farsi

Version:

Convert English digits to Persian digits AND MORE !

4 lines (3 loc) 131 B
export function toFarsiNumbers(number) { return number.toString().replace(/\d/g, (digit) => "۰۱۲۳۴۵۶۷۸۹"[digit]); }