{"id":37365331,"url":"https://github.com/nick-lai/round-decimal","last_synced_at":"2026-01-16T04:50:29.480Z","repository":{"id":63119368,"uuid":"565360254","full_name":"nick-lai/round-decimal","owner":"nick-lai","description":"Decimal rounding with ULP.","archived":false,"fork":false,"pushed_at":"2024-04-22T12:34:46.000Z","size":70,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-01T16:27:55.536Z","etag":null,"topics":["decimal","library","math","places","precision","round","round-decimal","rounding","ulp"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/nick-lai.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/funding.yml","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},"funding":{"custom":["https://www.buymeacoffee.com/nicklai"]}},"created_at":"2022-11-13T06:20:19.000Z","updated_at":"2025-09-11T11:03:14.000Z","dependencies_parsed_at":"2024-04-22T11:45:16.321Z","dependency_job_id":"6a668055-c4c4-4a5a-9bd6-803175e5b29c","html_url":"https://github.com/nick-lai/round-decimal","commit_stats":{"total_commits":13,"total_committers":2,"mean_commits":6.5,"dds":0.07692307692307687,"last_synced_commit":"5540aa7ba05bdd2495ce19fe8582f762d5ff2ac2"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/nick-lai/round-decimal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nick-lai%2Fround-decimal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nick-lai%2Fround-decimal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nick-lai%2Fround-decimal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nick-lai%2Fround-decimal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nick-lai","download_url":"https://codeload.github.com/nick-lai/round-decimal/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nick-lai%2Fround-decimal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28477210,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T03:13:13.607Z","status":"ssl_error","status_checked_at":"2026-01-16T03:11:47.863Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["decimal","library","math","places","precision","round","round-decimal","rounding","ulp"],"created_at":"2026-01-16T04:50:28.831Z","updated_at":"2026-01-16T04:50:29.474Z","avatar_url":"https://github.com/nick-lai.png","language":"TypeScript","funding_links":["https://www.buymeacoffee.com/nicklai"],"categories":[],"sub_categories":[],"readme":"# round-decimal\n\n[![CodeQL](https://github.com/nick-lai/round-decimal/actions/workflows/codeql.yml/badge.svg)](https://github.com/nick-lai/round-decimal/actions/workflows/codeql.yml)\n[![Test](https://github.com/nick-lai/round-decimal/actions/workflows/test.yml/badge.svg)](https://github.com/nick-lai/round-decimal/actions/workflows/test.yml)\n[![Coverage Status](https://coveralls.io/repos/github/nick-lai/round-decimal/badge.svg?branch=main)](https://coveralls.io/github/nick-lai/round-decimal?branch=main)\n[![npm](https://img.shields.io/npm/v/round-decimal)](https://www.npmjs.com/package/round-decimal)\n[![Bundle Size](https://img.shields.io/bundlephobia/minzip/round-decimal)](https://bundlephobia.com/package/round-decimal)\n\nDecimal rounding with [ULP](https://w.wiki/5xCp).\n\n\u003e **Warning**  \n\u003e Work in process\n\n## Installation\n\n### NPM\n\n```bash\nnpm install -D round-decimal\n```\n\n### CDN\n\n#### jsDelivr\n\nLoad `roundDecimal` from [jsDelivr](https://www.jsdelivr.com/package/npm/round-decimal).\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/round-decimal\"\u003e\u003c/script\u003e\n```\n\n#### unpkg\n\nLoad `roundDecimal` from [unpkg](https://unpkg.com/round-decimal/dist/).\n\n```html\n\u003cscript src=\"https://unpkg.com/round-decimal\"\u003e\u003c/script\u003e\n```\n\n## Usage\n\n### Syntax\n\n```javascript\nroundDecimal(value, minSignificantFractionDigits = 3)\n```\n\n### Description\n\nDecimal rounding with [ULP](https://w.wiki/5xCp).\n\n### Parameters\n\n- `value`\n  - A number.\n- `minSignificantFractionDigits`\n  - Minimum significant fraction digits.\n  - Default: `3`\n\n### Return value\n\nThe rounded value.\n\n### Examples\n\n```javascript\nimport roundDecimal from 'round-decimal';\n\nconsole.log(0.1 + 0.2); // 0.30000000000000004\nconsole.log(roundDecimal(0.1 + 0.2)); // 0.3\n\nconsole.log(-0.1 - 0.2); // -0.30000000000000004\nconsole.log(roundDecimal(-0.1 - 0.2)); // -0.3\n\nconsole.log(10000000000.1 + 10000000000.2); // 20000000000.300003\nconsole.log(roundDecimal(10000000000.1 + 10000000000.2)); // 20000000000.3\nconsole.log(roundDecimal(10000000000.1 + 10000000000.2, 6)); // 20000000000.300003\n\nconsole.log(10000000000000.1 + 10000000000000.2); // 20000000000000.297\nconsole.log(roundDecimal(10000000000000.1 + 10000000000000.2)); // 20000000000000.297\nconsole.log(roundDecimal(10000000000000.1 + 10000000000000.2, 2)); // 20000000000000.3\n\nconsole.log(roundDecimal(1.3549999999999998)); // 1.355\n```\n\nTry it out on [JSFiddle](https://jsfiddle.net/nick_lai/h09dfL5o/).\n\n## License\n\n[MIT](https://github.com/nick-lai/round-decimal/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnick-lai%2Fround-decimal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnick-lai%2Fround-decimal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnick-lai%2Fround-decimal/lists"}