Simple npm package to convert your english digits to farsi/arabic digits.
install to-farsi via npm package
npm i to-farsiimport to-farsi in your file
import toFarsiNumbers from "to-farsi";then use it like this
console.log(toFarsiNumbers(987654321)); // output: "۹۸۷۶۵۴۳۲۱"or in your front structure
<p>{toFarsiNumbers(123456789)}</p>I don't recommend to pass non-English digits to your database or in your logs and just use it when you want to show the number to your users.
give it a star if it was helpful! ⭐ MIT © cwpslxck