I want to change the English numerals to Nepali one up to 2 digits. For example: if I enter 1 it should return १ and if I enter 41 it should return ४१ and I have to store ४१ in DB and show it in the front end.
This is what I have done till now:
function convertNos($nos){
switch($nos){
case"०":return 0;
case"१":return 1;
case"२":return 2;
case"३":return 3;
case"४":return 4;
case"५":return 5;
case"६":return 6;
case"७":return 7;
case"८":return 8;
case"९":return 9;
case"0":return"०";
case"1":return"१";
case"2":return"२";
case"3":return"३";
case"4":return"४";
case"5":return"५";
case"6":return"६";
case"7":return"७";
case"8":return"८";
case"9":return"९";
}
}
Can someone help me solve this?