Created
July 31, 2012 21:46
-
-
Save premasagar/3220886 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function round(num, decimalplaces){ | |
return Number(num.toFixed(decimalplaces)); | |
} | |
function randomInt(length){ | |
return Math.ceil((length || 2) * Math.random()) - 1; | |
} | |
function randomRange(min, max){ | |
return Math.random() * (max - min) + min; | |
} | |
function randomIntRange(min, max){ | |
return randomInt(max + 1 - min) + min; | |
} | |
function now(){ | |
return (new Date().getTime()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment