Skip to content

Instantly share code, notes, and snippets.

@yoko
Created March 18, 2010 05:46
Show Gist options
  • Save yoko/336086 to your computer and use it in GitHub Desktop.
Save yoko/336086 to your computer and use it in GitHub Desktop.
Number.prototype.drop = function(digit) {
var n = Math.pow(10, digit || 0);
var ret = this * n;
ret = Math.floor(ret);
return (ret / n).toFixed(digit);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment