{"action":"created","comment":{"url":"https://api.github.com/repos/decred/dcrdata/pulls/comments/223384112","pull_request_review_id":162488293,"id":223384112,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMzM4NDExMg==","diff_hunk":"@@ -151,6 +151,39 @@ func float64Formatting(v float64, numPlaces int, useCommas bool, boldNumPlaces .\n \treturn []string{integer, dec[:places], dec[places:], trailingZeros}\n }\n \n+func amountAsDecimalPartsTrimmed(v int64, numPlaces int64, useCommas bool) []string {\n+\tamt := strconv.FormatInt(v, 10)\n+\tif len(amt) <= 8 {\n+\t\tdec := strings.TrimRight(amt, \"0\")\n+\t\ttrailingZeros := \"\"\n+\t\tleadingZeros := strings.Repeat(\"0\", 8-len(amt))\n+\t\tif (8 - len(amt)) > 2 {\n+\t\t\tleadingZeros = \"00\"\n+\t\t}\n+\t\treturn []string{\"0\", leadingZeros + dec, trailingZeros}\n+\t}\n+\tinteger := amt[:len(amt)-8]\n+\tif useCommas {\n+\t\tintegerAsInt64, err := strconv.ParseInt(integer, 10, 64)\n+\t\tif err != nil {\n+\t\t\tlog.Errorf(\"amountAsDecimalParts comma formatting failed. Input: %v Error: %v\", v, err.Error())\n+\t\t\tinteger = \"ERROR\"\n+\t\t\tdec := \"VALUE\"\n+\t\t\tzeros := \"\"\n+\t\t\treturn []string{integer, dec, zeros}\n+\t\t}\n+\t\tinteger = humanize.Comma(integerAsInt64)\n+\t}\n+\tdec := strings.TrimRight(amt[len(amt)-8:], \"0\")","path":"explorer/templates.go","position":27,"original_position":27,"commit_id":"862de52d0aa560c7526b91dfe34629e5f96f5e2a","original_commit_id":"862de52d0aa560c7526b91dfe34629e5f96f5e2a","user":{"login":"chappjc","id":9373513,"node_id":"MDQ6VXNlcjkzNzM1MTM=","avatar_url":"https://avatars1.githubusercontent.com/u/9373513?v=4","gravatar_id":"","url":"https://api.github.com/users/chappjc","html_url":"https://github.com/chappjc","followers_url":"https://api.github.com/users/chappjc/followers","following_url":"https://api.github.com/users/chappjc/following{/other_user}","gists_url":"https://api.github.com/users/chappjc/gists{/gist_id}","starred_url":"https://api.github.com/users/chappjc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chappjc/subscriptions","organizations_url":"https://api.github.com/users/chappjc/orgs","repos_url":"https://api.github.com/users/chappjc/repos","events_url":"https://api.github.com/users/chappjc/events{/privacy}","received_events_url":"https://api.github.com/users/chappjc/received_events","type":"User","site_admin":false},"body":"This function is still broken is several ways.  Fix the test and reference my previous comment on how to simplify this function and make it less error prone: https://github.com/decred/dcrdata/pull/721#discussion_r222837818","created_at":"2018-10-08T14:28:20Z","updated_at":"2018-10-08T14:29:05Z","html_url":"https://github.com/decred/dcrdata/pull/721#discussion_r223384112","pull_request_url":"https://api.github.com/repos/decred/dcrdata/pulls/721","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/decred/dcrdata/pulls/comments/223384112"},"html":{"href":"https://github.com/decred/dcrdata/pull/721#discussion_r223384112"},"pull_request":{"href":"https://api.github.com/repos/decred/dcrdata/pulls/721"}}},"pull_request":{"url":"https://api.github.com/repos/decred/dcrdata/pulls/721","id":220494675,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIwNDk0Njc1","html_url":"https://github.com/decred/dcrdata/pull/721","diff_url":"https://github.com/decred/dcrdata/pull/721.diff","patch_url":"https://github.com/decred/dcrdata/pull/721.patch","issue_url":"https://api.github.com/repos/decred/dcrdata/issues/721","number":721,"state":"open","locked":false,"title":"New Stats Page","user":{"login":"Jujhar","id":5521110,"node_id":"MDQ6VXNlcjU1MjExMTA=","avatar_url":"https://avatars0.githubusercontent.com/u/5521110?v=4","gravatar_id":"","url":"https://api.github.com/users/Jujhar","html_url":"https://github.com/Jujhar","followers_url":"https://api.github.com/users/Jujhar/followers","following_url":"https://api.github.com/users/Jujhar/following{/other_user}","gists_url":"https://api.github.com/users/Jujhar/gists{/gist_id}","starred_url":"https://api.github.com/users/Jujhar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jujhar/subscriptions","organizations_url":"https://api.github.com/users/Jujhar/orgs","repos_url":"https://api.github.com/users/Jujhar/repos","events_url":"https://api.github.com/users/Jujhar/events{/privacy}","received_events_url":"https://api.github.com/users/Jujhar/received_events","type":"User","site_admin":false},"body":"![stats page](https://user-images.githubusercontent.com/5521110/46498552-9adc7980-c7d2-11e8-937c-2fba1ea9b2b0.png)\r\n\r\nIncludes and built off #641 \r\nAddresses #451 ","created_at":"2018-10-04T19:42:17Z","updated_at":"2018-10-08T14:29:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ac00bf2aaa4dfbd08df348d72579dfce4a54d08b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/decred/dcrdata/pulls/721/commits","review_comments_url":"https://api.github.com/repos/decred/dcrdata/pulls/721/comments","review_comment_url":"https://api.github.com/repos/decred/dcrdata/pulls/comments{/number}","comments_url":"https://api.github.com/repos/decred/dcrdata/issues/721/comments","statuses_url":"https://api.github.com/repos/decred/dcrdata/statuses/862de52d0aa560c7526b91dfe34629e5f96f5e2a","head":{"label":"Jujhar:stats_page","ref":"stats_page","sha":"862de52d0aa560c7526b91dfe34629e5f96f5e2a","user":{"login":"Jujhar","id":5521110,"node_id":"MDQ6VXNlcjU1MjExMTA=","avatar_url":"https://avatars0.githubusercontent.com/u/5521110?v=4","gravatar_id":"","url":"https://api.github.com/users/Jujhar","html_url":"https://github.com/Jujhar","followers_url":"https://api.github.com/users/Jujhar/followers","following_url":"https://api.github.com/users/Jujhar/following{/other_user}","gists_url":"https://api.github.com/users/Jujhar/gists{/gist_id}","starred_url":"https://api.github.com/users/Jujhar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jujhar/subscriptions","organizations_url":"https://api.github.com/users/Jujhar/orgs","repos_url":"https://api.github.com/users/Jujhar/repos","events_url":"https://api.github.com/users/Jujhar/events{/privacy}","received_events_url":"https://api.github.com/users/Jujhar/received_events","type":"User","site_admin":false},"repo":{"id":148549464,"node_id":"MDEwOlJlcG9zaXRvcnkxNDg1NDk0NjQ=","name":"dcrdata","full_name":"Jujhar/dcrdata","private":false,"owner":{"login":"Jujhar","id":5521110,"node_id":"MDQ6VXNlcjU1MjExMTA=","avatar_url":"https://avatars0.githubusercontent.com/u/5521110?v=4","gravatar_id":"","url":"https://api.github.com/users/Jujhar","html_url":"https://github.com/Jujhar","followers_url":"https://api.github.com/users/Jujhar/followers","following_url":"https://api.github.com/users/Jujhar/following{/other_user}","gists_url":"https://api.github.com/users/Jujhar/gists{/gist_id}","starred_url":"https://api.github.com/users/Jujhar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jujhar/subscriptions","organizations_url":"https://api.github.com/users/Jujhar/orgs","repos_url":"https://api.github.com/users/Jujhar/repos","events_url":"https://api.github.com/users/Jujhar/events{/privacy}","received_events_url":"https://api.github.com/users/Jujhar/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Jujhar/dcrdata","description":"Decred block explorer, with packages and apps for data collection and storage. Written in Go.","fork":true,"url":"https://api.github.com/repos/Jujhar/dcrdata","forks_url":"https://api.github.com/repos/Jujhar/dcrdata/forks","keys_url":"https://api.github.com/repos/Jujhar/dcrdata/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Jujhar/dcrdata/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Jujhar/dcrdata/teams","hooks_url":"https://api.github.com/repos/Jujhar/dcrdata/hooks","issue_events_url":"https://api.github.com/repos/Jujhar/dcrdata/issues/events{/number}","events_url":"https://api.github.com/repos/Jujhar/dcrdata/events","assignees_url":"https://api.github.com/repos/Jujhar/dcrdata/assignees{/user}","branches_url":"https://api.github.com/repos/Jujhar/dcrdata/branches{/branch}","tags_url":"https://api.github.com/repos/Jujhar/dcrdata/tags","blobs_url":"https://api.github.com/repos/Jujhar/dcrdata/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Jujhar/dcrdata/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Jujhar/dcrdata/git/refs{/sha}","trees_url":"https://api.github.com/repos/Jujhar/dcrdata/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Jujhar/dcrdata/statuses/{sha}","languages_url":"https://api.github.com/repos/Jujhar/dcrdata/languages","stargazers_url":"https://api.github.com/repos/Jujhar/dcrdata/stargazers","contributors_url":"https://api.github.com/repos/Jujhar/dcrdata/contributors","subscribers_url":"https://api.github.com/repos/Jujhar/dcrdata/subscribers","subscription_url":"https://api.github.com/repos/Jujhar/dcrdata/subscription","commits_url":"https://api.github.com/repos/Jujhar/dcrdata/commits{/sha}","git_commits_url":"https://api.github.com/repos/Jujhar/dcrdata/git/commits{/sha}","comments_url":"https://api.github.com/repos/Jujhar/dcrdata/comments{/number}","issue_comment_url":"https://api.github.com/repos/Jujhar/dcrdata/issues/comments{/number}","contents_url":"https://api.github.com/repos/Jujhar/dcrdata/contents/{+path}","compare_url":"https://api.github.com/repos/Jujhar/dcrdata/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Jujhar/dcrdata/merges","archive_url":"https://api.github.com/repos/Jujhar/dcrdata/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Jujhar/dcrdata/downloads","issues_url":"https://api.github.com/repos/Jujhar/dcrdata/issues{/number}","pulls_url":"https://api.github.com/repos/Jujhar/dcrdata/pulls{/number}","milestones_url":"https://api.github.com/repos/Jujhar/dcrdata/milestones{/number}","notifications_url":"https://api.github.com/repos/Jujhar/dcrdata/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Jujhar/dcrdata/labels{/name}","releases_url":"https://api.github.com/repos/Jujhar/dcrdata/releases{/id}","deployments_url":"https://api.github.com/repos/Jujhar/dcrdata/deployments","created_at":"2018-09-12T22:23:55Z","updated_at":"2018-10-04T14:25:45Z","pushed_at":"2018-10-08T04:48:17Z","git_url":"git://github.com/Jujhar/dcrdata.git","ssh_url":"git@github.com:Jujhar/dcrdata.git","clone_url":"https://github.com/Jujhar/dcrdata.git","svn_url":"https://github.com/Jujhar/dcrdata","homepage":"https://explorer.dcrdata.org/","size":8784,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"isc","name":"ISC License","spdx_id":"ISC","url":"https://api.github.com/licenses/isc","node_id":"MDc6TGljZW5zZTEw"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"decred:master","ref":"master","sha":"322f9ea9805f196d3f447290b51a6a016f3943b4","user":{"login":"decred","id":16297194,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Mjk3MTk0","avatar_url":"https://avatars3.githubusercontent.com/u/16297194?v=4","gravatar_id":"","url":"https://api.github.com/users/decred","html_url":"https://github.com/decred","followers_url":"https://api.github.com/users/decred/followers","following_url":"https://api.github.com/users/decred/following{/other_user}","gists_url":"https://api.github.com/users/decred/gists{/gist_id}","starred_url":"https://api.github.com/users/decred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/decred/subscriptions","organizations_url":"https://api.github.com/users/decred/orgs","repos_url":"https://api.github.com/users/decred/repos","events_url":"https://api.github.com/users/decred/events{/privacy}","received_events_url":"https://api.github.com/users/decred/received_events","type":"Organization","site_admin":false},"repo":{"id":82826361,"node_id":"MDEwOlJlcG9zaXRvcnk4MjgyNjM2MQ==","name":"dcrdata","full_name":"decred/dcrdata","private":false,"owner":{"login":"decred","id":16297194,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Mjk3MTk0","avatar_url":"https://avatars3.githubusercontent.com/u/16297194?v=4","gravatar_id":"","url":"https://api.github.com/users/decred","html_url":"https://github.com/decred","followers_url":"https://api.github.com/users/decred/followers","following_url":"https://api.github.com/users/decred/following{/other_user}","gists_url":"https://api.github.com/users/decred/gists{/gist_id}","starred_url":"https://api.github.com/users/decred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/decred/subscriptions","organizations_url":"https://api.github.com/users/decred/orgs","repos_url":"https://api.github.com/users/decred/repos","events_url":"https://api.github.com/users/decred/events{/privacy}","received_events_url":"https://api.github.com/users/decred/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/decred/dcrdata","description":"Decred block explorer, with packages and apps for data collection and storage. Written in Go.","fork":false,"url":"https://api.github.com/repos/decred/dcrdata","forks_url":"https://api.github.com/repos/decred/dcrdata/forks","keys_url":"https://api.github.com/repos/decred/dcrdata/keys{/key_id}","collaborators_url":"https://api.github.com/repos/decred/dcrdata/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/decred/dcrdata/teams","hooks_url":"https://api.github.com/repos/decred/dcrdata/hooks","issue_events_url":"https://api.github.com/repos/decred/dcrdata/issues/events{/number}","events_url":"https://api.github.com/repos/decred/dcrdata/events","assignees_url":"https://api.github.com/repos/decred/dcrdata/assignees{/user}","branches_url":"https://api.github.com/repos/decred/dcrdata/branches{/branch}","tags_url":"https://api.github.com/repos/decred/dcrdata/tags","blobs_url":"https://api.github.com/repos/decred/dcrdata/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/decred/dcrdata/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/decred/dcrdata/git/refs{/sha}","trees_url":"https://api.github.com/repos/decred/dcrdata/git/trees{/sha}","statuses_url":"https://api.github.com/repos/decred/dcrdata/statuses/{sha}","languages_url":"https://api.github.com/repos/decred/dcrdata/languages","stargazers_url":"https://api.github.com/repos/decred/dcrdata/stargazers","contributors_url":"https://api.github.com/repos/decred/dcrdata/contributors","subscribers_url":"https://api.github.com/repos/decred/dcrdata/subscribers","subscription_url":"https://api.github.com/repos/decred/dcrdata/subscription","commits_url":"https://api.github.com/repos/decred/dcrdata/commits{/sha}","git_commits_url":"https://api.github.com/repos/decred/dcrdata/git/commits{/sha}","comments_url":"https://api.github.com/repos/decred/dcrdata/comments{/number}","issue_comment_url":"https://api.github.com/repos/decred/dcrdata/issues/comments{/number}","contents_url":"https://api.github.com/repos/decred/dcrdata/contents/{+path}","compare_url":"https://api.github.com/repos/decred/dcrdata/compare/{base}...{head}","merges_url":"https://api.github.com/repos/decred/dcrdata/merges","archive_url":"https://api.github.com/repos/decred/dcrdata/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/decred/dcrdata/downloads","issues_url":"https://api.github.com/repos/decred/dcrdata/issues{/number}","pulls_url":"https://api.github.com/repos/decred/dcrdata/pulls{/number}","milestones_url":"https://api.github.com/repos/decred/dcrdata/milestones{/number}","notifications_url":"https://api.github.com/repos/decred/dcrdata/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/decred/dcrdata/labels{/name}","releases_url":"https://api.github.com/repos/decred/dcrdata/releases{/id}","deployments_url":"https://api.github.com/repos/decred/dcrdata/deployments","created_at":"2017-02-22T16:24:53Z","updated_at":"2018-10-06T14:43:50Z","pushed_at":"2018-10-08T04:48:19Z","git_url":"git://github.com/decred/dcrdata.git","ssh_url":"git@github.com:decred/dcrdata.git","clone_url":"https://github.com/decred/dcrdata.git","svn_url":"https://github.com/decred/dcrdata","homepage":"https://explorer.dcrdata.org/","size":8742,"stargazers_count":59,"watchers_count":59,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":77,"mirror_url":null,"archived":false,"open_issues_count":83,"license":{"key":"isc","name":"ISC License","spdx_id":"ISC","url":"https://api.github.com/licenses/isc","node_id":"MDc6TGljZW5zZTEw"},"forks":77,"open_issues":83,"watchers":59,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/decred/dcrdata/pulls/721"},"html":{"href":"https://github.com/decred/dcrdata/pull/721"},"issue":{"href":"https://api.github.com/repos/decred/dcrdata/issues/721"},"comments":{"href":"https://api.github.com/repos/decred/dcrdata/issues/721/comments"},"review_comments":{"href":"https://api.github.com/repos/decred/dcrdata/pulls/721/comments"},"review_comment":{"href":"https://api.github.com/repos/decred/dcrdata/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/decred/dcrdata/pulls/721/commits"},"statuses":{"href":"https://api.github.com/repos/decred/dcrdata/statuses/862de52d0aa560c7526b91dfe34629e5f96f5e2a"}},"author_association":"NONE"}}
{"actor":{"display_login":"chappjc"}}