Created
November 15, 2023 05:19
-
-
Save ameer/be71f19b17226423def17bfded471fb2 to your computer and use it in GitHub Desktop.
Convert Persian Numbers/Digits to English Numbers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _d = (s) => { | |
// Convert Persian Number to English Numbers | |
return s && s.length > 0 | |
? s.replace(/[\u0660-\u0669\u06F0-\u06F9]/g, function (a) { | |
return a.charCodeAt(0) & 0xf; | |
}) | |
: s; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment