FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Problem-solving-with-JavaScript/problem-4.js at master · anasmak04/Problem-solving-with-JavaScript · GitHub
anasmak04
/
Problem-solving-with-JavaScript
Public
forked from
mehediislamripon/Problem-solving-with-JavaScript
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Problem-solving-with-JavaScript
/
problem-4.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
34 lines (28 loc) · 753 Bytes
Breadcrumbs
Problem-solving-with-JavaScript
/
problem-4.js
Copy path
File metadata and controls
34 lines (28 loc) · 753 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
var
finalEnglishToBanglaNumber
=
{
0
:
"০"
,
1
:
"১"
,
2
:
"২"
,
3
:
"৩"
,
4
:
"৪"
,
5
:
"৫"
,
6
:
"৬"
,
7
:
"৭"
,
8
:
"৮"
,
9
:
"৯"
,
}
;
String
.
prototype
.
getDigitBanglaFromEnglish
=
function
(
)
{
var
retStr
=
this
;
for
(
var
x
in
finalEnglishToBanglaNumber
)
{
retStr
=
retStr
.
replace
(
new
RegExp
(
x
,
"g"
)
,
finalEnglishToBanglaNumber
[
x
]
)
;
}
return
retStr
;
}
;
var
english_number
=
"123456"
;
var
bangla_converted_number
=
english_number
.
getDigitBanglaFromEnglish
(
)
;
//outputs : ১২৩৪৫৬
console
.
log
(
bangla_converted_number
)
;
//or alert(bangla_converted_number);
// another reference
// https://stackoverflow.com/questions/30629242/javascript-replace-to-english-number
Back
|
FazBrowse Home
|
New Git URL