bitcore/Number.monkey.js

9 lines
246 B
JavaScript
Raw Normal View History

2013-07-18 09:01:12 -07:00
exports.patch = function(Number) {
//round to specified number of places
Number.prototype.round = function(places) {
if(!places) return Math.round(this);
var tmp = Math.pow(10,places);
return Math.round(this * tmp) / tmp;
};
};