Website Statistics

Online Since

Ranked Jsvalidate Config 2 Php Ajax Fader 3 Jsvalidate Password 4 Stumbleupon Clickheat 5 Config 6 Php Ajax 7 Ajax Fader 8 Password 9 Clickheat 10 Stumbleupon on Alexa.com

Google Indexed Pages

Estimated Incoming Links

Yesterday, Steve asked me how can we have random number function in JavaScript like rand() function of PHP where the programmer can specify the range of two numbers within which we need the random number. Today, I'm going to share two functions in JavaScript, In first function , you can specify the number and the function generate the random number between 1 and N. In another JavaScript function, you can specify range of two numbers between which you've to get a random number. Furthermore, there is optional last parameter in these function for decimal places, if provided, will return the random number with the decimal places specified in the third parameter.



Who Voted for this Story


Comments


Log in to comment or register here.