Pages
Home
My Zend Framework CMS
Creating a datagrid in Zend Framework
My Portfolio
Thursday, July 28, 2011
Useful javascript function: Math.round() with precision
Math._round = Math.round;
Math.round = function(number, precision)
{
precision = Math.abs(parseInt(precision)) || 0;
var coefficient = Math.pow(10, precision);
return Math._round(number*coefficient)/coefficient;
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment