Last active
February 2, 2026 17:15
-
-
Save eimg/35a632807e0451740c0893e40762f18b to your computer and use it in GitHub Desktop.
Convert Myanmar numbers to English numbers
This file contains hidden or 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
| // INPUT: ၁၁.၁၂.၂၀၁၇ | |
| // OUTPUT: 11.12.2017 | |
| function mm2en(num) { | |
| var nums = { '၀': '0', '၁': 1, '၂': 2, '၃': 3, '၄': 4 , '၅': 5, '၆': 6, '၇':7, '၈':8, '၉':9 }; | |
| return num.replace(/([၀-၉])/g, function(s, key) { | |
| return nums[key] || s; | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
16
16
16
15
15
15
15
14
14
14
14
14
14
14
14
13
13
13
12
12
12
12
12
11
11
10
10
10
10
10
10
9
9
9
9