Number.prototype.toFixed=function(x) {
var temp=this;
temp=Math.round(temp*Math.pow(10,x))/Math.pow(10,x);
return temp;
}
Round floats
Category: Uncategorized |
Tags: decimal, float, integer, javascript, prototype, real, round, tofixed
Leave a Reply
You must be logged in to post a comment.