{"action":"opened","issue":{"url":"https://api.github.com/repos/melonjs/melonJS/issues/868","repository_url":"https://api.github.com/repos/melonjs/melonJS","labels_url":"https://api.github.com/repos/melonjs/melonJS/issues/868/labels{/name}","comments_url":"https://api.github.com/repos/melonjs/melonJS/issues/868/comments","events_url":"https://api.github.com/repos/melonjs/melonJS/issues/868/events","html_url":"https://github.com/melonjs/melonJS/issues/868","id":206142477,"number":868,"title":"Bug in Number.prototype.round function","user":{"login":"Sairahcaz","id":7384870,"avatar_url":"https://avatars.githubusercontent.com/u/7384870?v=3","gravatar_id":"","url":"https://api.github.com/users/Sairahcaz","html_url":"https://github.com/Sairahcaz","followers_url":"https://api.github.com/users/Sairahcaz/followers","following_url":"https://api.github.com/users/Sairahcaz/following{/other_user}","gists_url":"https://api.github.com/users/Sairahcaz/gists{/gist_id}","starred_url":"https://api.github.com/users/Sairahcaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sairahcaz/subscriptions","organizations_url":"https://api.github.com/users/Sairahcaz/orgs","repos_url":"https://api.github.com/users/Sairahcaz/repos","events_url":"https://api.github.com/users/Sairahcaz/events{/privacy}","received_events_url":"https://api.github.com/users/Sairahcaz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-02-08T09:38:14Z","updated_at":"2017-02-08T09:38:14Z","closed_at":null,"body":"Think this: \r\n```javascript\r\nNumber.prototype.round = function (num, dec) {\r\n    // if only one argument use the object value\r\n    num = (arguments.length < 2) ? this : num;\r\n    var powres = Math.pow(10, dec || num || 0);\r\n    return (~~(0.5 + num * powres) / powres);\r\n};\r\n```\r\n\r\nshould be like this?: \r\n```javascript\r\nNumber.prototype.round = function (num, dec) {\r\n    // if only one argument use the object value\r\n    if (dec) {\r\n        dec = num;\r\n        num = this;\r\n    }\r\n    var powres = Math.pow(10, dec || num || 0);\r\n    return (~~(0.5 + num * powres) / powres);\r\n};\r\n```"}}
{"actor":{"display_login":"Sairahcaz"}}