{"action":"created","issue":{"url":"https://api.github.com/repos/thijsmie/tantalus/issues/3","repository_url":"https://api.github.com/repos/thijsmie/tantalus","labels_url":"https://api.github.com/repos/thijsmie/tantalus/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/thijsmie/tantalus/issues/3/comments","events_url":"https://api.github.com/repos/thijsmie/tantalus/issues/3/events","html_url":"https://github.com/thijsmie/tantalus/issues/3","id":267228582,"number":3,"title":"Precedence of operators in calculating modifiers","user":{"login":"mrngm","id":305101,"avatar_url":"https://avatars0.githubusercontent.com/u/305101?v=4","gravatar_id":"","url":"https://api.github.com/users/mrngm","html_url":"https://github.com/mrngm","followers_url":"https://api.github.com/users/mrngm/followers","following_url":"https://api.github.com/users/mrngm/following{/other_user}","gists_url":"https://api.github.com/users/mrngm/gists{/gist_id}","starred_url":"https://api.github.com/users/mrngm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrngm/subscriptions","organizations_url":"https://api.github.com/users/mrngm/orgs","repos_url":"https://api.github.com/users/mrngm/repos","events_url":"https://api.github.com/users/mrngm/events{/privacy}","received_events_url":"https://api.github.com/users/mrngm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-10-20T16:16:56Z","updated_at":"2017-10-20T18:24:23Z","closed_at":null,"author_association":"NONE","body":"https://github.com/thijsmie/tantalus/blob/5fb666d7fd179b8e7883af381466eac7b51bbcb7/ndbextensions/models.py#L65\r\nhttps://github.com/thijsmie/tantalus/blob/5fb666d7fd179b8e7883af381466eac7b51bbcb7/ndbextensions/models.py#L68\r\n\r\nAre you sure these precedence of operators are correct? The `pre_add` suggests an addition is done on `line.value`, similarly for `post_add`.\r\n\r\nThis causes serious calculation errors (example of line 65; the last column is probably incorrect, but shows the effect of braces). I think the following formula is correct: \r\n\r\n```python\r\n((line.value + self.pre_add) (*/) self.multiplier + self.post_add)*line.amount\r\n```\r\n\r\n![2017-10-20-181253_701x204_scrot](https://user-images.githubusercontent.com/305101/31831035-5037b7f0-b5c2-11e7-8a72-1ce2fbde8be8.png)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/thijsmie/tantalus/issues/comments/338285965","html_url":"https://github.com/thijsmie/tantalus/issues/3#issuecomment-338285965","issue_url":"https://api.github.com/repos/thijsmie/tantalus/issues/3","id":338285965,"user":{"login":"thijsmie","id":4019032,"avatar_url":"https://avatars3.githubusercontent.com/u/4019032?v=4","gravatar_id":"","url":"https://api.github.com/users/thijsmie","html_url":"https://github.com/thijsmie","followers_url":"https://api.github.com/users/thijsmie/followers","following_url":"https://api.github.com/users/thijsmie/following{/other_user}","gists_url":"https://api.github.com/users/thijsmie/gists{/gist_id}","starred_url":"https://api.github.com/users/thijsmie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thijsmie/subscriptions","organizations_url":"https://api.github.com/users/thijsmie/orgs","repos_url":"https://api.github.com/users/thijsmie/repos","events_url":"https://api.github.com/users/thijsmie/events{/privacy}","received_events_url":"https://api.github.com/users/thijsmie/received_events","type":"User","site_admin":false},"created_at":"2017-10-20T18:24:23Z","updated_at":"2017-10-20T18:24:23Z","author_association":"OWNER","body":"The value of a line is always its total amount and thus does not need to be multiplied, while an addition is define per item so does need multiplication, so I'm quite convinced my formula is correct."}}
{"actor":{"display_login":"thijsmie"}}