Skip to content

Instantly share code, notes, and snippets.

@eimg
Last active August 21, 2026 14:44
Show Gist options
  • Select an option

  • Save eimg/35a632807e0451740c0893e40762f18b to your computer and use it in GitHub Desktop.

Select an option

Save eimg/35a632807e0451740c0893e40762f18b to your computer and use it in GitHub Desktop.
Convert Myanmar numbers to English numbers
// 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;
});
}
@masoyein

masoyein commented Feb 2, 2026

Copy link
Copy Markdown

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

@masoyein

Copy link
Copy Markdown

၁,၀၀၀,၀၀၀

၁,၀၀၀,၀၀၀
၆၀၀၀၀၀
၅၀၀,၀၀၀
၅၀၀,၀၀၀
၄၀၀,၀၀၀
၄၀၀,၀၀၀
၂၅၀,၀၀၀
၂၅၀,၀၀၀
၂၀၀,၀၀၀
၂၀၀,၀၀၀
၂၀၀,၀၀၀
၂၀၀,၀၀၀
၂၀၀,၀၀၀
၂၀၀,၀၀၀
၂၀၀,၀၀၀
၂၀၀,၀၀၀
၂၀၀,၀၀၀
၁၀၀,၀၀၀
၁၀၀,၀၀၀
၁၀၀,၀၀၀
၁၅၀,၀၀၀
၁၅၀,၀၀၀
၁၅၀,၀၀၀
၁၅၀,၀၀၀
၁၅၀,၀၀၀
၁၀၀,၀၀၀
၁၀၀,၀၀၀
၁၀၀,၀၀၀
၁၀၀,၀၀၀
၁၀၀,၀၀၀
၁၀၀,၀၀၀
၁၀၀,၀၀၀
၂၀၀,၀၀၀
၂,၀၀၀,၀၀၀
၁,၀၀၀,၀၀၀
၅၀၀,၀၀၀
၅၀၀,၀၀၀
၂၀၀,၀၀၀
၂၀၀,၀၀၀
၂၀၀,၀၀၀
၂၀၀,၀၀၀
၂၀၀,၀၀၀
၂၀၀,၀၀၀
၂၀၀,၀၀၀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment