{"action":"created","issue":{"url":"https://api.github.com/repos/Starcounter/Starcounter/issues/3841","repository_url":"https://api.github.com/repos/Starcounter/Starcounter","labels_url":"https://api.github.com/repos/Starcounter/Starcounter/issues/3841/labels{/name}","comments_url":"https://api.github.com/repos/Starcounter/Starcounter/issues/3841/comments","events_url":"https://api.github.com/repos/Starcounter/Starcounter/issues/3841/events","html_url":"https://github.com/Starcounter/Starcounter/issues/3841","id":176841655,"number":3841,"title":"ScErrCLRDecToX6DecRangeError (SCERR4246)","user":{"login":"IdieHeads","id":22190489,"avatar_url":"https://avatars.githubusercontent.com/u/22190489?v=3","gravatar_id":"","url":"https://api.github.com/users/IdieHeads","html_url":"https://github.com/IdieHeads","followers_url":"https://api.github.com/users/IdieHeads/followers","following_url":"https://api.github.com/users/IdieHeads/following{/other_user}","gists_url":"https://api.github.com/users/IdieHeads/gists{/gist_id}","starred_url":"https://api.github.com/users/IdieHeads/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IdieHeads/subscriptions","organizations_url":"https://api.github.com/users/IdieHeads/orgs","repos_url":"https://api.github.com/users/IdieHeads/repos","events_url":"https://api.github.com/users/IdieHeads/events{/privacy}","received_events_url":"https://api.github.com/users/IdieHeads/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Starcounter/Starcounter/labels/question","name":"question","color":"02d7e1"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-09-14T08:07:13Z","updated_at":"2016-10-17T13:28:58Z","closed_at":null,"body":"Get this exception when trying to set the value 4.91071428571429\r\nRuning Starcounter-Stable-2.2.1834 (Apr 19, 2016 9:41:00 PM)\r\n\r\n{\"ScErrCLRDecToX6DecRangeError (SCERR4246): The CLR Decimal cannot be converted to a Starcounter X6 decimal without data loss. Range error.\\r\\nVersion: 2.2.1834.\\r\\nHelp page: https://github.com/Starcounter/Starcounter/wiki/SCERR4246.\"}"},"comment":{"url":"https://api.github.com/repos/Starcounter/Starcounter/issues/comments/254207274","html_url":"https://github.com/Starcounter/Starcounter/issues/3841#issuecomment-254207274","issue_url":"https://api.github.com/repos/Starcounter/Starcounter/issues/3841","id":254207274,"user":{"login":"linkdata","id":2185977,"avatar_url":"https://avatars.githubusercontent.com/u/2185977?v=3","gravatar_id":"","url":"https://api.github.com/users/linkdata","html_url":"https://github.com/linkdata","followers_url":"https://api.github.com/users/linkdata/followers","following_url":"https://api.github.com/users/linkdata/following{/other_user}","gists_url":"https://api.github.com/users/linkdata/gists{/gist_id}","starred_url":"https://api.github.com/users/linkdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linkdata/subscriptions","organizations_url":"https://api.github.com/users/linkdata/orgs","repos_url":"https://api.github.com/users/linkdata/repos","events_url":"https://api.github.com/users/linkdata/events{/privacy}","received_events_url":"https://api.github.com/users/linkdata/received_events","type":"User","site_admin":false},"created_at":"2016-10-17T13:28:58Z","updated_at":"2016-10-17T13:28:58Z","body":"Even if we accept that X6Decimal is enough for our purposes and we don't need to be able to represent things like the United States gross national product (16.77 trillion USD), the recommended average transaction fee per byte for Bitcoins (0.0000001 BTC) or the value of the Nikkei 225 monthly trades in January 2015 (50,518,545,574,000 Yen), we should still expect it to throw SCERR4246 when it can't convert.\r\n\r\nThis should throw an exception, but instead silently corrupts data:\r\n\r\n```cs\r\n        public void TestX6Decimal()\r\n        {\r\n            const decimal expected = 16770000000000.0m; // United States gross national product\r\n            var encoded = X6Decimal.ToRaw(expected); // Should throw exception or convert\r\n            var actual = X6Decimal.FromRaw(encoded);\r\n            Assert.Equal(expected, actual); // Fails, actual == -1676744073709,551616 \r\n        }\r\n```\r\n"}}
{"actor":{"display_login":"linkdata"}}