Skip to content

Instantly share code, notes, and snippets.

@nicksheffield
Created February 25, 2015 00:17
Show Gist options
  • Save nicksheffield/d4cc9228de0dca472dc0 to your computer and use it in GitHub Desktop.
Save nicksheffield/d4cc9228de0dca472dc0 to your computer and use it in GitHub Desktop.
random number generator
// r( max, min, decimal places)
function r(a,b,c){ return parseFloat((Math.random()*((a?a:1)-(b?b:0))+(b?b:0)).toFixed(c?c:0)); }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment