{"id":29605621,"url":"https://github.com/codemonument/deno_simple_rounding","last_synced_at":"2025-07-20T16:06:48.228Z","repository":{"id":304164972,"uuid":"871133765","full_name":"codemonument/deno_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-11T12:04:39.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-11T14:07:43.968Z","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-11T12:03:24.000Z","dependencies_parsed_at":"2025-07-11T14:07:48.097Z","dependency_job_id":"11d743b7-514d-4243-b846-ae07b88bcfb3","html_url":"https://github.com/codemonument/deno_simple_rounding","commit_stats":null,"previous_names":["codemonument/deno_simple_rounding"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/codemonument/deno_simple_rounding","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonument%2Fdeno_simple_rounding","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonument%2Fdeno_simple_rounding/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonument%2Fdeno_simple_rounding/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonument%2Fdeno_simple_rounding/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codemonument","download_url":"https://codeload.github.com/codemonument/deno_simple_rounding/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonument%2Fdeno_simple_rounding/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266152721,"owners_count":23884567,"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":[],"created_at":"2025-07-20T16:06:47.559Z","updated_at":"2025-07-20T16:06:48.216Z","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 deno module, containing relieable custom functions for rounding, ceiling, flooring, truncating and formatting floating point numbers.\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.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%2Fdeno_simple_rounding","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodemonument%2Fdeno_simple_rounding","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemonument%2Fdeno_simple_rounding/lists"}