{"action":"closed","issue":{"url":"https://api.github.com/repos/epeli/underscore.string/issues/401","labels_url":"https://api.github.com/repos/epeli/underscore.string/issues/401/labels{/name}","comments_url":"https://api.github.com/repos/epeli/underscore.string/issues/401/comments","events_url":"https://api.github.com/repos/epeli/underscore.string/issues/401/events","html_url":"https://github.com/epeli/underscore.string/issues/401","id":56315127,"number":401,"title":"Number format ceils value, bad for accounting.","user":{"login":"Nijikokun","id":198276,"avatar_url":"https://avatars.githubusercontent.com/u/198276?v=3","gravatar_id":"","url":"https://api.github.com/users/Nijikokun","html_url":"https://github.com/Nijikokun","followers_url":"https://api.github.com/users/Nijikokun/followers","following_url":"https://api.github.com/users/Nijikokun/following{/other_user}","gists_url":"https://api.github.com/users/Nijikokun/gists{/gist_id}","starred_url":"https://api.github.com/users/Nijikokun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nijikokun/subscriptions","organizations_url":"https://api.github.com/users/Nijikokun/orgs","repos_url":"https://api.github.com/users/Nijikokun/repos","events_url":"https://api.github.com/users/Nijikokun/events{/privacy}","received_events_url":"https://api.github.com/users/Nijikokun/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/epeli/underscore.string/labels/won't%20fix","name":"won't fix","color":"e11d21"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-03T00:21:09Z","updated_at":"2015-02-06T08:01:23Z","closed_at":"2015-02-06T08:01:23Z","body":"https://github.com/epeli/underscore.string/blob/master/numberFormat.js#L4 specifically.\r\n\r\nThe function here will produce floored fixed numbers with high accuracy:\r\n\r\n```js\r\n  /**\r\n   * Multiplies specified number by decimal places to the tenth power, floors, then divides by the same\r\n   * number to determine a floored decimal value.\r\n   *\r\n   * Examples:\r\n   *\r\n   *     toFixedFloored(15.8695, 2) -> 15.86\r\n   *     toFixedFloored(15.7787, 2) -> 15.77\r\n   *     toFixedFloored(15, 2) -> 15.00\r\n   *\r\n   * @param {Number} number   Number to be floored and repositioned\r\n   * @param {Number} decimals Number of decimal places to position this number.\r\n   */\r\n  function toFixedFloored (number, decimals) {\r\n    var d;\r\n    decimals = decimals || 0;\r\n    d = Math.pow(10, decimals);\r\n    return (parseInt(number * d) / d).toFixed(decimals);\r\n  };\r\n```\r\n\r\n"}}