{"id":31213747,"url":"https://github.com/codemonument/simple-rounding","last_synced_at":"2025-09-21T08:18:28.281Z","repository":{"id":304164972,"uuid":"871133765","full_name":"codemonument/simple-rounding","owner":"codemonument","description":"A deno module, containing relieable custom functions for rounding, ceiling, flooring, truncating and formatting floating point numbers.","archived":false,"fork":false,"pushed_at":"2025-07-27T06:16:26.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-10T00:57:36.102Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://jsr.io/@codemonument/simple-rounding","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/codemonument.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,"zenodo":null}},"created_at":"2024-10-11T10:39:54.000Z","updated_at":"2025-07-27T06:18:49.000Z","dependencies_parsed_at":"2025-07-11T14:07:48.097Z","dependency_job_id":"11d743b7-514d-4243-b846-ae07b88bcfb3","html_url":"https://github.com/codemonument/simple-rounding","commit_stats":null,"previous_names":["codemonument/deno_simple_rounding","codemonument/simple-rounding"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/codemonument/simple-rounding","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonument%2Fsimple-rounding","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonument%2Fsimple-rounding/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonument%2Fsimple-rounding/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonument%2Fsimple-rounding/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codemonument","download_url":"https://codeload.github.com/codemonument/simple-rounding/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonument%2Fsimple-rounding/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276210448,"owners_count":25603724,"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","status":"online","status_checked_at":"2025-09-21T02:00:07.055Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-09-21T08:18:26.893Z","updated_at":"2025-09-21T08:18:28.277Z","avatar_url":"https://github.com/codemonument.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @codemonument/simple-rounding\n\n[![JSR](https://jsr.io/badges/@codemonument/simple-rounding)](https://jsr.io/package/@codemonument/simple-rounding)\n\nA TypeScript/JavaScript module containing reliable custom functions for rounding, ceiling, flooring, truncating and formatting floating point numbers. Works with Deno, Node.js, Bun, and browsers.\n\n**Keywords:** rounding, floating-point, precision, math, decimal, ceiling, floor, truncate, typescript, javascript, deno, node, bun\n\n## Why?\n\nBasic Problem: JS Floating Point Math is highly inaccurate.\nFound this thread: https://stackoverflow.com/questions/11832914/how-to-round-to-at-most-2-decimal-places-if-necessary\n\nFirst best solution: Use a library with correct implementation of floating point math.\n\n- mathjs (CAUTION: not math.js!): https://www.npmjs.com/package/mathjs\n\n  - is basically complete, but is FAT: 732 kB, 188 kB minified\n  - see https://bundlephobia.com/package/mathjs@13.1.1\n\n- decimal.js: https://www.npmjs.com/package/decimal.js\n\n  - still 31.1 kB, 12.3kB minified\n  - good: last Publish in 2022 (today: 2024-09-09)\n\n- currency.js: https://www.npmjs.com/package/currency.js\n  - 2.2kB, 1kB minified\n  - no dependencies\n  - BUT: only compatible with TS allowSyntheticDefaultImports: true + default import\n\nSecond best solution: Use a custom implementation of roundToPrecision  \n@bjesuiter original selected implementation (on 2024-09-09):  \nhttps://stackoverflow.com/questions/11832914/how-to-round-to-at-most-2-decimal-places-if-necessary#:~:text=Solution%202%3A%20purely%20mathematical%20(Number.EPSILON)\n\n2025-07-11: refined multiple times \n\n---\n# Changelog \n\n## 2.0.1 - 2025-07-27\n\n- refined examples and published files\n\n## 2.0.0 - 2025-07-11\n\n- reworked the whole implementation and added more tests and examples\n\n## 1.0.0 \n\nInitial release\n\n---\n\n# For Contributors\n\n## Deploy a new version\n\n1. Update the version in deno.json\n2. Update all examples \u0026 docs\n3. Run `deno task test` \u0026 fix errors\n4. Run `deno task dry` \u0026 fix errors`\n5. Commit, make a tag and push the tag (will then be built by github actions)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemonument%2Fsimple-rounding","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodemonument%2Fsimple-rounding","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemonument%2Fsimple-rounding/lists"}