{"action":"created","issue":{"url":"https://api.github.com/repos/indutny/bn.js/issues/182","repository_url":"https://api.github.com/repos/indutny/bn.js","labels_url":"https://api.github.com/repos/indutny/bn.js/issues/182/labels{/name}","comments_url":"https://api.github.com/repos/indutny/bn.js/issues/182/comments","events_url":"https://api.github.com/repos/indutny/bn.js/issues/182/events","html_url":"https://github.com/indutny/bn.js/issues/182","id":312707330,"node_id":"MDU6SXNzdWUzMTI3MDczMzA=","number":182,"title":"Decimal handling with div arithmetic","user":{"login":"GeeeCoin","id":32784002,"node_id":"MDQ6VXNlcjMyNzg0MDAy","avatar_url":"https://avatars2.githubusercontent.com/u/32784002?v=4","gravatar_id":"","url":"https://api.github.com/users/GeeeCoin","html_url":"https://github.com/GeeeCoin","followers_url":"https://api.github.com/users/GeeeCoin/followers","following_url":"https://api.github.com/users/GeeeCoin/following{/other_user}","gists_url":"https://api.github.com/users/GeeeCoin/gists{/gist_id}","starred_url":"https://api.github.com/users/GeeeCoin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GeeeCoin/subscriptions","organizations_url":"https://api.github.com/users/GeeeCoin/orgs","repos_url":"https://api.github.com/users/GeeeCoin/repos","events_url":"https://api.github.com/users/GeeeCoin/events{/privacy}","received_events_url":"https://api.github.com/users/GeeeCoin/received_events","type":"User","site_admin":false},"labels":[{"id":95278853,"node_id":"MDU6TGFiZWw5NTI3ODg1Mw==","url":"https://api.github.com/repos/indutny/bn.js/labels/question%20/%20documentation","name":"question / documentation","color":"2bb227","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-04-09T22:17:19Z","updated_at":"2018-12-20T09:16:52Z","closed_at":"2018-06-06T05:38:52Z","author_association":"NONE","body":"How does the `.div()` method handle decimals?"},"comment":{"url":"https://api.github.com/repos/indutny/bn.js/issues/comments/448927990","html_url":"https://github.com/indutny/bn.js/issues/182#issuecomment-448927990","issue_url":"https://api.github.com/repos/indutny/bn.js/issues/182","id":448927990,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0ODkyNzk5MA==","user":{"login":"jtakalai","id":16594664,"node_id":"MDQ6VXNlcjE2NTk0NjY0","avatar_url":"https://avatars2.githubusercontent.com/u/16594664?v=4","gravatar_id":"","url":"https://api.github.com/users/jtakalai","html_url":"https://github.com/jtakalai","followers_url":"https://api.github.com/users/jtakalai/followers","following_url":"https://api.github.com/users/jtakalai/following{/other_user}","gists_url":"https://api.github.com/users/jtakalai/gists{/gist_id}","starred_url":"https://api.github.com/users/jtakalai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtakalai/subscriptions","organizations_url":"https://api.github.com/users/jtakalai/orgs","repos_url":"https://api.github.com/users/jtakalai/repos","events_url":"https://api.github.com/users/jtakalai/events{/privacy}","received_events_url":"https://api.github.com/users/jtakalai/received_events","type":"User","site_admin":false},"created_at":"2018-12-20T09:16:52Z","updated_at":"2018-12-20T09:16:52Z","author_association":"NONE","body":"Following worked for me:\r\n```\r\nfunction e(x, n) { \r\n  base = new BN(10).pow(new BN(n));\r\n  dm = new BN(x).divmod(base);\r\n  return dm.div + \".\" + dm.mod.toString(10, n)\r\n}\r\n\r\ne(10000, 3) // === \"10.000\"\r\n```\r\n\r\nNot sure if there is a library function already?"}}
{"actor":{"display_login":"jtakalai"}}