{"action":"opened","number":751,"pull_request":{"url":"https://api.github.com/repos/RubyMoney/money/pulls/751","id":169258208,"html_url":"https://github.com/RubyMoney/money/pull/751","diff_url":"https://github.com/RubyMoney/money/pull/751.diff","patch_url":"https://github.com/RubyMoney/money/pull/751.patch","issue_url":"https://api.github.com/repos/RubyMoney/money/issues/751","number":751,"state":"open","locked":false,"title":"[WIP] Refactor formatter","user":{"login":"antstorm","id":118353,"avatar_url":"https://avatars1.githubusercontent.com/u/118353?v=4","gravatar_id":"","url":"https://api.github.com/users/antstorm","html_url":"https://github.com/antstorm","followers_url":"https://api.github.com/users/antstorm/followers","following_url":"https://api.github.com/users/antstorm/following{/other_user}","gists_url":"https://api.github.com/users/antstorm/gists{/gist_id}","starred_url":"https://api.github.com/users/antstorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antstorm/subscriptions","organizations_url":"https://api.github.com/users/antstorm/orgs","repos_url":"https://api.github.com/users/antstorm/repos","events_url":"https://api.github.com/users/antstorm/events{/privacy}","received_events_url":"https://api.github.com/users/antstorm/received_events","type":"User","site_admin":false},"body":"The former solution is really messy and ineffective — reformatting the value back and forth to get the correct result. This new solution establishes the correct numeric value first, splits it into whole and decimal parts, which are then formatted individually before being combined into the result.\r\n\r\nWhile testing this I realised than MGA formatting was incorrect the whole time (this might need clarification from someone who's familiar with the currency better). I think it should be something like this:\r\n\r\n1 Iraimbilanja = 0.2 arairy\r\n1.5 Iraimbilanja = 0.3 ariary\r\n6 Iraimbilanja = 1.2 ariary","created_at":"2018-02-15T00:21:05Z","updated_at":"2018-02-15T00:21:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/RubyMoney/money/pulls/751/commits","review_comments_url":"https://api.github.com/repos/RubyMoney/money/pulls/751/comments","review_comment_url":"https://api.github.com/repos/RubyMoney/money/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RubyMoney/money/issues/751/comments","statuses_url":"https://api.github.com/repos/RubyMoney/money/statuses/84254f929d6ee9d98849eb4028dd367e34d1de53","head":{"label":"antstorm:refactor-formatter","ref":"refactor-formatter","sha":"84254f929d6ee9d98849eb4028dd367e34d1de53","user":{"login":"antstorm","id":118353,"avatar_url":"https://avatars1.githubusercontent.com/u/118353?v=4","gravatar_id":"","url":"https://api.github.com/users/antstorm","html_url":"https://github.com/antstorm","followers_url":"https://api.github.com/users/antstorm/followers","following_url":"https://api.github.com/users/antstorm/following{/other_user}","gists_url":"https://api.github.com/users/antstorm/gists{/gist_id}","starred_url":"https://api.github.com/users/antstorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antstorm/subscriptions","organizations_url":"https://api.github.com/users/antstorm/orgs","repos_url":"https://api.github.com/users/antstorm/repos","events_url":"https://api.github.com/users/antstorm/events{/privacy}","received_events_url":"https://api.github.com/users/antstorm/received_events","type":"User","site_admin":false},"repo":{"id":38616759,"name":"money","full_name":"antstorm/money","owner":{"login":"antstorm","id":118353,"avatar_url":"https://avatars1.githubusercontent.com/u/118353?v=4","gravatar_id":"","url":"https://api.github.com/users/antstorm","html_url":"https://github.com/antstorm","followers_url":"https://api.github.com/users/antstorm/followers","following_url":"https://api.github.com/users/antstorm/following{/other_user}","gists_url":"https://api.github.com/users/antstorm/gists{/gist_id}","starred_url":"https://api.github.com/users/antstorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antstorm/subscriptions","organizations_url":"https://api.github.com/users/antstorm/orgs","repos_url":"https://api.github.com/users/antstorm/repos","events_url":"https://api.github.com/users/antstorm/events{/privacy}","received_events_url":"https://api.github.com/users/antstorm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/antstorm/money","description":"A Ruby Library for dealing with money and currency conversion.","fork":true,"url":"https://api.github.com/repos/antstorm/money","forks_url":"https://api.github.com/repos/antstorm/money/forks","keys_url":"https://api.github.com/repos/antstorm/money/keys{/key_id}","collaborators_url":"https://api.github.com/repos/antstorm/money/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/antstorm/money/teams","hooks_url":"https://api.github.com/repos/antstorm/money/hooks","issue_events_url":"https://api.github.com/repos/antstorm/money/issues/events{/number}","events_url":"https://api.github.com/repos/antstorm/money/events","assignees_url":"https://api.github.com/repos/antstorm/money/assignees{/user}","branches_url":"https://api.github.com/repos/antstorm/money/branches{/branch}","tags_url":"https://api.github.com/repos/antstorm/money/tags","blobs_url":"https://api.github.com/repos/antstorm/money/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/antstorm/money/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/antstorm/money/git/refs{/sha}","trees_url":"https://api.github.com/repos/antstorm/money/git/trees{/sha}","statuses_url":"https://api.github.com/repos/antstorm/money/statuses/{sha}","languages_url":"https://api.github.com/repos/antstorm/money/languages","stargazers_url":"https://api.github.com/repos/antstorm/money/stargazers","contributors_url":"https://api.github.com/repos/antstorm/money/contributors","subscribers_url":"https://api.github.com/repos/antstorm/money/subscribers","subscription_url":"https://api.github.com/repos/antstorm/money/subscription","commits_url":"https://api.github.com/repos/antstorm/money/commits{/sha}","git_commits_url":"https://api.github.com/repos/antstorm/money/git/commits{/sha}","comments_url":"https://api.github.com/repos/antstorm/money/comments{/number}","issue_comment_url":"https://api.github.com/repos/antstorm/money/issues/comments{/number}","contents_url":"https://api.github.com/repos/antstorm/money/contents/{+path}","compare_url":"https://api.github.com/repos/antstorm/money/compare/{base}...{head}","merges_url":"https://api.github.com/repos/antstorm/money/merges","archive_url":"https://api.github.com/repos/antstorm/money/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/antstorm/money/downloads","issues_url":"https://api.github.com/repos/antstorm/money/issues{/number}","pulls_url":"https://api.github.com/repos/antstorm/money/pulls{/number}","milestones_url":"https://api.github.com/repos/antstorm/money/milestones{/number}","notifications_url":"https://api.github.com/repos/antstorm/money/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/antstorm/money/labels{/name}","releases_url":"https://api.github.com/repos/antstorm/money/releases{/id}","deployments_url":"https://api.github.com/repos/antstorm/money/deployments","created_at":"2015-07-06T12:15:06Z","updated_at":"2016-01-18T22:58:47Z","pushed_at":"2018-02-15T00:09:53Z","git_url":"git://github.com/antstorm/money.git","ssh_url":"git@github.com:antstorm/money.git","clone_url":"https://github.com/antstorm/money.git","svn_url":"https://github.com/antstorm/money","homepage":"http://rubymoney.github.io/money","size":2081,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"RubyMoney:master","ref":"master","sha":"d01bcf013bff27069e970fd8bf83ff804f41148b","user":{"login":"RubyMoney","id":351550,"avatar_url":"https://avatars1.githubusercontent.com/u/351550?v=4","gravatar_id":"","url":"https://api.github.com/users/RubyMoney","html_url":"https://github.com/RubyMoney","followers_url":"https://api.github.com/users/RubyMoney/followers","following_url":"https://api.github.com/users/RubyMoney/following{/other_user}","gists_url":"https://api.github.com/users/RubyMoney/gists{/gist_id}","starred_url":"https://api.github.com/users/RubyMoney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RubyMoney/subscriptions","organizations_url":"https://api.github.com/users/RubyMoney/orgs","repos_url":"https://api.github.com/users/RubyMoney/repos","events_url":"https://api.github.com/users/RubyMoney/events{/privacy}","received_events_url":"https://api.github.com/users/RubyMoney/received_events","type":"Organization","site_admin":false},"repo":{"id":70121,"name":"money","full_name":"RubyMoney/money","owner":{"login":"RubyMoney","id":351550,"avatar_url":"https://avatars1.githubusercontent.com/u/351550?v=4","gravatar_id":"","url":"https://api.github.com/users/RubyMoney","html_url":"https://github.com/RubyMoney","followers_url":"https://api.github.com/users/RubyMoney/followers","following_url":"https://api.github.com/users/RubyMoney/following{/other_user}","gists_url":"https://api.github.com/users/RubyMoney/gists{/gist_id}","starred_url":"https://api.github.com/users/RubyMoney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RubyMoney/subscriptions","organizations_url":"https://api.github.com/users/RubyMoney/orgs","repos_url":"https://api.github.com/users/RubyMoney/repos","events_url":"https://api.github.com/users/RubyMoney/events{/privacy}","received_events_url":"https://api.github.com/users/RubyMoney/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RubyMoney/money","description":"A Ruby Library for dealing with money and currency conversion.","fork":false,"url":"https://api.github.com/repos/RubyMoney/money","forks_url":"https://api.github.com/repos/RubyMoney/money/forks","keys_url":"https://api.github.com/repos/RubyMoney/money/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RubyMoney/money/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RubyMoney/money/teams","hooks_url":"https://api.github.com/repos/RubyMoney/money/hooks","issue_events_url":"https://api.github.com/repos/RubyMoney/money/issues/events{/number}","events_url":"https://api.github.com/repos/RubyMoney/money/events","assignees_url":"https://api.github.com/repos/RubyMoney/money/assignees{/user}","branches_url":"https://api.github.com/repos/RubyMoney/money/branches{/branch}","tags_url":"https://api.github.com/repos/RubyMoney/money/tags","blobs_url":"https://api.github.com/repos/RubyMoney/money/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RubyMoney/money/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RubyMoney/money/git/refs{/sha}","trees_url":"https://api.github.com/repos/RubyMoney/money/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RubyMoney/money/statuses/{sha}","languages_url":"https://api.github.com/repos/RubyMoney/money/languages","stargazers_url":"https://api.github.com/repos/RubyMoney/money/stargazers","contributors_url":"https://api.github.com/repos/RubyMoney/money/contributors","subscribers_url":"https://api.github.com/repos/RubyMoney/money/subscribers","subscription_url":"https://api.github.com/repos/RubyMoney/money/subscription","commits_url":"https://api.github.com/repos/RubyMoney/money/commits{/sha}","git_commits_url":"https://api.github.com/repos/RubyMoney/money/git/commits{/sha}","comments_url":"https://api.github.com/repos/RubyMoney/money/comments{/number}","issue_comment_url":"https://api.github.com/repos/RubyMoney/money/issues/comments{/number}","contents_url":"https://api.github.com/repos/RubyMoney/money/contents/{+path}","compare_url":"https://api.github.com/repos/RubyMoney/money/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RubyMoney/money/merges","archive_url":"https://api.github.com/repos/RubyMoney/money/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RubyMoney/money/downloads","issues_url":"https://api.github.com/repos/RubyMoney/money/issues{/number}","pulls_url":"https://api.github.com/repos/RubyMoney/money/pulls{/number}","milestones_url":"https://api.github.com/repos/RubyMoney/money/milestones{/number}","notifications_url":"https://api.github.com/repos/RubyMoney/money/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RubyMoney/money/labels{/name}","releases_url":"https://api.github.com/repos/RubyMoney/money/releases{/id}","deployments_url":"https://api.github.com/repos/RubyMoney/money/deployments","created_at":"2008-10-31T15:05:03Z","updated_at":"2018-02-10T21:35:36Z","pushed_at":"2018-02-15T00:09:16Z","git_url":"git://github.com/RubyMoney/money.git","ssh_url":"git@github.com:RubyMoney/money.git","clone_url":"https://github.com/RubyMoney/money.git","svn_url":"https://github.com/RubyMoney/money","homepage":"http://rubymoney.github.io/money","size":2091,"stargazers_count":1912,"watchers_count":1912,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":459,"mirror_url":null,"archived":false,"open_issues_count":22,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":459,"open_issues":22,"watchers":1912,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/RubyMoney/money/pulls/751"},"html":{"href":"https://github.com/RubyMoney/money/pull/751"},"issue":{"href":"https://api.github.com/repos/RubyMoney/money/issues/751"},"comments":{"href":"https://api.github.com/repos/RubyMoney/money/issues/751/comments"},"review_comments":{"href":"https://api.github.com/repos/RubyMoney/money/pulls/751/comments"},"review_comment":{"href":"https://api.github.com/repos/RubyMoney/money/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RubyMoney/money/pulls/751/commits"},"statuses":{"href":"https://api.github.com/repos/RubyMoney/money/statuses/84254f929d6ee9d98849eb4028dd367e34d1de53"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":3,"additions":73,"deletions":75,"changed_files":2}}
{"actor":{"display_login":"antstorm"}}