Rounding prototypes for JavaScript

JavaScript does include some standard methods for rounding numbers, but if you’re working on a project that involves calling them frequently, it can get a little tiring. Especially if you need to round to a certain number of decimal places as opposed to an integer. I haven’t encountered this situation much, but I though it would be a neat exercise for some new Number.prototype methods. Try it!

Tagged with:
Posted in Custom Library Functions, JavaScript, Try It