Skip to main content

[Actionscript] Function to translate a number into number of Indic or non-english numerals.

This function is very Useful in displaying numbers in Indic Languages.
Input: Any Number in English.
Output: String in Hindi/Any Language Used in the variable devNum.
Environment: Flash/Actionscript 2.0

function fnTranslate(param){
var num = param.toString();
 //Assuming the user input is a valid natural number in English.
var devNum:String="०१२३४५६७८९"; 
 //replace this string by Indic/Non-English numerals
var strOut="";
for(i=0;i<num.length;i++){
s=num.charAt(i);
strOut=strOut+devNum.charAt(s);
}
return strOut;
}

Comments

Popular posts from this blog

access logs to PDT

zgrep "text" /var/log/nginx/access.log | awk '{print $6}' | sed -e 's/\"/\ /g' | awk -F'[:/]' '{   # Build a new date string that GNU date can understand   timestamp = $1 " " $2 " " $3 " " $4 ":" $5 ":" $6   cmd = "TZ=\"America/Los_Angeles\" date -d \"" timestamp " UTC\" \"+%Y-%m-%d %H:%M:%S %Z\""   cmd | getline converted   close(cmd)   print converted }'

Using a SOAP service as DLL

By default, when you do an Add Service Reference operation, the WCF runtime will generate the client-side proxy for you. The simplest way to use it is to instantiate the client proxy with a constructor that takes no parameters, and just grab the info from the app.config : YourServiceClient proxy = new YourServiceClient(); This requires the config file to have a <client> entry with your service contract - if not, you'll get the error you have. But the client side proxy class generated by the WCF runtime also has additional constructors - one takes an endpoint address and a binding, for instance: BasicHttpBinding binding = new BasicHttpBinding(); binding.Security.Mode = BasicHttpSecurityMode.Transport;  EndpointAddress epa = new EndpointAddress("http://example.com/api/?wsdl"); YourServiceClient proxy = new YourServiceClient(binding, epa); With this setup, no config file at all is needed - you're defining everything in code. Of course, you can also s...

Designing for Digital Marketing: How to Get Started

It is not uncommon for web designers and developers to think about aspects such as search engine optimization (SEO) and email marketing when designing a website. After all, there are a lot of optimizations to be added to the design […] from Inspirationfeed https://ift.tt/2zLtz0T