Round in javascript

function roundTo(decimalpositions)
{
    var i = this * Math.pow(10,decimalpositions);
    i = Math.round(i);
    return i / Math.pow(10,decimalpositions);
}
Number.prototype.roundTo = roundTo;

posted @ venerdì 28 novembre 2008 12:24

Print

Comments on this entry:

# re: Round in javascript

Left by he at 13/11/2014 18:44
Gravatar
becoming fundamentally mobile check credit score product news cost credit report score important rolling out 079
Comments have been closed on this topic.
«dicembre»
domlunmarmergiovensab
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234