{"id":23297555,"url":"https://github.com/drag13/roundto","last_synced_at":"2025-04-06T19:54:07.822Z","repository":{"id":33116475,"uuid":"138142643","full_name":"Drag13/RoundTo","owner":"Drag13","description":"Small function that rounds number with selected precision","archived":false,"fork":false,"pushed_at":"2023-03-04T02:43:00.000Z","size":155,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-13T18:42:17.612Z","etag":null,"topics":["javscript","math","round","rounding"],"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/Drag13.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-06-21T08:33:42.000Z","updated_at":"2021-05-08T07:32:17.000Z","dependencies_parsed_at":"2024-12-20T07:19:13.486Z","dependency_job_id":"a3c73591-8f80-4ffe-80d3-85471bbed2ac","html_url":"https://github.com/Drag13/RoundTo","commit_stats":{"total_commits":29,"total_committers":3,"mean_commits":9.666666666666666,"dds":0.5172413793103448,"last_synced_commit":"416937a2a65897b8675150ca1e7147d246b262b6"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Drag13%2FRoundTo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Drag13%2FRoundTo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Drag13%2FRoundTo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Drag13%2FRoundTo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Drag13","download_url":"https://codeload.github.com/Drag13/RoundTo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247543608,"owners_count":20955865,"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":["javscript","math","round","rounding"],"created_at":"2024-12-20T07:18:27.564Z","updated_at":"2025-04-06T19:54:07.801Z","avatar_url":"https://github.com/Drag13.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RoundTo\n\n[![codecov](https://codecov.io/gh/Drag13/RoundTo/branch/master/graph/badge.svg)](https://codecov.io/gh/Drag13/RoundTo)\n[![Build Status](https://travis-ci.org/Drag13/RoundTo.svg?branch=master)](https://travis-ci.org/Drag13/RoundTo)\n[![npm](https://img.shields.io/npm/dt/@drag13/round-to.svg)](https://www.npmjs.com/package/@drag13/round-to)\n[![TypeSCript](https://img.shields.io/badge/TypeScript-Ready-brightgreen.svg)](https://github.com/Drag13/RoundTo)\n[![GitHub license](https://img.shields.io/github/license/Drag13/RoundTo.svg)](https://github.com/Drag13/RoundTo/blob/master/LICENSE)\n\n## Description\n\nSmall one-function-lib to round numbers with custom precision. TypeScript ready.\n\n## Installation\n\n  `npm install @drag13/round-to`\n\n## Usage\n\nRoundTo function rounds your decimal with selected precesion. It also tries to handle edge cases with floating point using Epsilon shift and nano-robots.\n\n``` javascript\nconst round = require('@drag13/round-to');\nconst roundingResult = round(5.4399, 2);\nconsole.assert(roundingResult===5.44);\n```\n\n## TypeScript\n\nFeel free to use it with TypeScript\n\n``` typescript\nimport * as round from '@drag13/round-to';\nconst roundingResult = round(5.4399, 2);\nconsole.assert(roundingResult===5.44);\n```\n\n## Tests\n\n`npm test`\n\n## Some covered cases\n\n```javascript\nconsole.assert(roundTo(0.43499999999999994, 2)===0.435);\nconsole.assert(roundTo(Math.PI, 2)===3.14);\n```\n\n## Contributing\n\nAny bug fixing is appreciated. If you want to add new functionality - you're welcome. But KISS it please.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrag13%2Froundto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrag13%2Froundto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrag13%2Froundto/lists"}