{"action":"opened","issue":{"url":"https://api.github.com/repos/sindresorhus/round-to/issues/12","repository_url":"https://api.github.com/repos/sindresorhus/round-to","labels_url":"https://api.github.com/repos/sindresorhus/round-to/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/sindresorhus/round-to/issues/12/comments","events_url":"https://api.github.com/repos/sindresorhus/round-to/issues/12/events","html_url":"https://github.com/sindresorhus/round-to/issues/12","id":369586632,"node_id":"MDU6SXNzdWUzNjk1ODY2MzI=","number":12,"title":"Performance of roundTo.down","user":{"login":"edolganov","id":3048752,"node_id":"MDQ6VXNlcjMwNDg3NTI=","avatar_url":"https://avatars2.githubusercontent.com/u/3048752?v=4","gravatar_id":"","url":"https://api.github.com/users/edolganov","html_url":"https://github.com/edolganov","followers_url":"https://api.github.com/users/edolganov/followers","following_url":"https://api.github.com/users/edolganov/following{/other_user}","gists_url":"https://api.github.com/users/edolganov/gists{/gist_id}","starred_url":"https://api.github.com/users/edolganov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edolganov/subscriptions","organizations_url":"https://api.github.com/users/edolganov/orgs","repos_url":"https://api.github.com/users/edolganov/repos","events_url":"https://api.github.com/users/edolganov/events{/privacy}","received_events_url":"https://api.github.com/users/edolganov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-12T14:53:59Z","updated_at":"2018-10-12T14:53:59Z","closed_at":null,"author_association":"NONE","body":"Hi!\r\nI checked **roundTo.down** method and the alternative one:\r\n```\r\nvar delta = Math.pow(10, precision)\r\nvar result = Math.floor(input * delta) / delta;\r\n```\r\n\r\nExample: \r\n```\r\n>> Math.floor(110.30115528834406 * 100000000) / 100000000\r\n<< 110.30115528\r\n```\r\n\r\nI used both implementations 1,000,000 times. \r\nCheck out results:\r\n:-1: **roundTo.down** -  1.396 sec\r\n:+1: **alternative** - 0.017sec  \r\n\r\nHope it will help you to improve a roundTo.down performance :smiley: "}}
{"actor":{"display_login":"edolganov"}}