{"id":17359432,"url":"https://github.com/dreamdevil00/tofixed","last_synced_at":"2025-03-27T15:34:27.036Z","repository":{"id":143893471,"uuid":"154647980","full_name":"dreamdevil00/tofixed","owner":"dreamdevil00","description":"Rewrite Number.prototype.toFixed to make it consistent across any environement and add more precision","archived":false,"fork":false,"pushed_at":"2018-10-25T10:39:03.000Z","size":39,"stargazers_count":0,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-01T19:23:06.863Z","etag":null,"topics":["precision","tofixed"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dreamdevil00.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-25T09:53:55.000Z","updated_at":"2018-10-25T10:39:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"c3e5824c-d1de-427d-ac24-874e1ebb5fff","html_url":"https://github.com/dreamdevil00/tofixed","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreamdevil00%2Ftofixed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreamdevil00%2Ftofixed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreamdevil00%2Ftofixed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreamdevil00%2Ftofixed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dreamdevil00","download_url":"https://codeload.github.com/dreamdevil00/tofixed/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245872333,"owners_count":20686359,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["precision","tofixed"],"created_at":"2024-10-15T19:09:36.371Z","updated_at":"2025-03-27T15:34:27.003Z","avatar_url":"https://github.com/dreamdevil00.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Number.prototype.toFixed() rewrite\n\n## Description\n\nAs we know, Number.prototype.toFixed() has many problems due to precision.\n\nFor example, in NodeJS 8.11.3\n\n```javascript\n(5.395).toFixed(2); // 5.39\n-(5.395).toFixed(2); // -5.39\n(1.395).toFixed(2); // 1.40\n-(1.395).toFixed(2); // -1.4\n```\n\nand in IE9\n\n```javascript\n(5.395).toFixed(2); // 5.40\n-(5.395).toFixed(2); // -5.4\n(1.395).toFixed(2); // 1.40\n-(1.395).toFixed(2); // -1.4\n```\n\nThis lib aims to make it consistent across any environment,\n\nand above test result will be\n\n```javascript\n(5.395).toFixed(2); // 5.40\n-(5.395).toFixed(2); // -5.4\n(1.395).toFixed(2); // 1.40\n-(1.395).toFixed(2); // -1.40\n```\n\n## How to use\n\nIntroduce it before your code\n\nfor example:\n\n```javascript\nrequire('index');\n// or\nimport './index.js';\n\n// other codes\n// ...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdreamdevil00%2Ftofixed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdreamdevil00%2Ftofixed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdreamdevil00%2Ftofixed/lists"}