Skip to content

Instantly share code, notes, and snippets.

@IUnknown68
Last active November 25, 2015 13:12
Show Gist options
  • Save IUnknown68/5ad7029387fc3a02153d to your computer and use it in GitHub Desktop.
Save IUnknown68/5ad7029387fc3a02153d to your computer and use it in GitHub Desktop.
Generate a 1-2-5-10-20-50... scale
function createScale(vals, iterations) {
var m = vals.length * iterations;
for (var n = 0; n < m; n++) {
var x = vals[n % vals.length] * Math.pow(10, Math.floor(n / vals.length));
console.log(x);
}
}
createScale([1,2,5], 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment