javascript round decimal to preferred number of decimal places
function round(value, decimals) { return Number(Math.round(value + 'e' + decimals) + 'e-' + decimals); }
Achievement provides the only real pleasure in life
function round(value, decimals) { return Number(Math.round(value + 'e' + decimals) + 'e-' + decimals); }
Posted by SF at 8:33 pm
No comments:
Post a Comment