{"action":"created","issue":{"url":"https://api.github.com/repos/DestinyItemManager/DIM/issues/320","labels_url":"https://api.github.com/repos/DestinyItemManager/DIM/issues/320/labels{/name}","comments_url":"https://api.github.com/repos/DestinyItemManager/DIM/issues/320/comments","events_url":"https://api.github.com/repos/DestinyItemManager/DIM/issues/320/events","html_url":"https://github.com/DestinyItemManager/DIM/pull/320","id":112850516,"number":320,"title":"update formula, simplify logic","user":{"login":"kyleshay","id":424158,"avatar_url":"https://avatars.githubusercontent.com/u/424158?v=3","gravatar_id":"","url":"https://api.github.com/users/kyleshay","html_url":"https://github.com/kyleshay","followers_url":"https://api.github.com/users/kyleshay/followers","following_url":"https://api.github.com/users/kyleshay/following{/other_user}","gists_url":"https://api.github.com/users/kyleshay/gists{/gist_id}","starred_url":"https://api.github.com/users/kyleshay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyleshay/subscriptions","organizations_url":"https://api.github.com/users/kyleshay/orgs","repos_url":"https://api.github.com/users/kyleshay/repos","events_url":"https://api.github.com/users/kyleshay/events{/privacy}","received_events_url":"https://api.github.com/users/kyleshay/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-22T17:22:42Z","updated_at":"2015-10-22T18:20:44Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/DestinyItemManager/DIM/pulls/320","html_url":"https://github.com/DestinyItemManager/DIM/pull/320","diff_url":"https://github.com/DestinyItemManager/DIM/pull/320.diff","patch_url":"https://github.com/DestinyItemManager/DIM/pull/320.patch"},"body":"based on the work by @Apsu in issue https://github.com/DestinyItemManager/DIM/issues/303\r\n\r\nthe diff is borderline useless, [here is the just the updated code](\r\nhttps://github.com/DestinyItemManager/DIM/blob/66b5927f172c46ec1587245713924f5c16762dd5/app/scripts/infuse/dimInfuse.factory.js#L18-L33)"},"comment":{"url":"https://api.github.com/repos/DestinyItemManager/DIM/issues/comments/150312169","html_url":"https://github.com/DestinyItemManager/DIM/pull/320#issuecomment-150312169","issue_url":"https://api.github.com/repos/DestinyItemManager/DIM/issues/320","id":150312169,"user":{"login":"Apsu","id":1023042,"avatar_url":"https://avatars.githubusercontent.com/u/1023042?v=3","gravatar_id":"","url":"https://api.github.com/users/Apsu","html_url":"https://github.com/Apsu","followers_url":"https://api.github.com/users/Apsu/followers","following_url":"https://api.github.com/users/Apsu/following{/other_user}","gists_url":"https://api.github.com/users/Apsu/gists{/gist_id}","starred_url":"https://api.github.com/users/Apsu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Apsu/subscriptions","organizations_url":"https://api.github.com/users/Apsu/orgs","repos_url":"https://api.github.com/users/Apsu/repos","events_url":"https://api.github.com/users/Apsu/events{/privacy}","received_events_url":"https://api.github.com/users/Apsu/received_events","type":"User","site_admin":false},"created_at":"2015-10-22T18:20:44Z","updated_at":"2015-10-22T18:20:44Z","body":"Cool! This is almost right, except that Math.round in Javascript doesn't actually do IEEE 754 \"Round Half To Even\" rounding, unfortunately. It does \"Round Half Up\". Here's a link to a pretty robust function that could be used for it, but there's various implementations of Guassian/Banker's/Half-Even rounding out there in various libraries: http://stackoverflow.com/a/3109234\r\n\r\nThere's even a few relatively simple ways to try to solve it for just 0.5 (0 decimal places in result), that might be good options."}}