{"id":21681857,"url":"https://github.com/alvarocastro/round","last_synced_at":"2025-03-20T10:51:21.251Z","repository":{"id":37980752,"uuid":"251428899","full_name":"alvarocastro/round","owner":"alvarocastro","description":"Round values up to an amount of decimals","archived":false,"fork":false,"pushed_at":"2023-01-25T07:05:59.000Z","size":1257,"stargazers_count":1,"open_issues_count":14,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-14T06:55:58.545Z","etag":null,"topics":["float","floating-point","math","round"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@alvarocastro/round","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/alvarocastro.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}},"created_at":"2020-03-30T21:09:15.000Z","updated_at":"2023-01-31T18:02:07.000Z","dependencies_parsed_at":"2023-02-14T05:31:41.800Z","dependency_job_id":null,"html_url":"https://github.com/alvarocastro/round","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvarocastro%2Fround","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvarocastro%2Fround/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvarocastro%2Fround/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvarocastro%2Fround/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alvarocastro","download_url":"https://codeload.github.com/alvarocastro/round/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244584946,"owners_count":20476636,"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":["float","floating-point","math","round"],"created_at":"2024-11-25T15:32:02.403Z","updated_at":"2025-03-20T10:51:21.227Z","avatar_url":"https://github.com/alvarocastro.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Round\n\n[![NPM](https://img.shields.io/npm/v/@alvarocastro/round)](https://www.npmjs.com/package/@alvarocastro/round)\n[![Build status](https://img.shields.io/github/workflow/status/alvarocastro/round/build)](https://github.com/alvarocastro/round/actions?query=workflow%3Abuild)\n[![Maintainability status](https://img.shields.io/codeclimate/maintainability/alvarocastro/round)](https://codeclimate.com/github/alvarocastro/round/maintainability)\n[![Coverage status](https://img.shields.io/coveralls/github/alvarocastro/round)](https://coveralls.io/github/alvarocastro/round?branch=master)\n[![Bundle size](https://img.shields.io/bundlephobia/min/@alvarocastro/round)](https://bundlephobia.com/result?p=@alvarocastro/round)\n[![Code style: XO](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo)\n[![Release: Semantic](https://img.shields.io/badge/%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n\nRound values up to an amount of decimals, avoiding the floating point weirdness of JavaScript.\n\n- [Install](#install)\n- [Usage](#usage)\n- [Contributing](#contributing)\n- [Support](#support)\n\n## Install\n\n```bash\nnpm install @alvarocastro/round\n```\n\n## Usage\n\n```js\nconst round = require('@alvarocastro/round');\n\nround(1.005);\n// =\u003e 1.01\nround(2.2222, 1);\n// =\u003e 1.1\nround(3, 5);\n// =\u003e 3\n```\n\n### round(number[, decimals = 2])\n\nReturns the value rounded up to a given amout of decimals.\n\n#### number\n\nType: `Number`\n\nValue to round.\n\n#### decimals\n\nType: `Number`\u003cbr\u003e\nDefault: 2\n\nThe amount of decimals to round the number to.\n\n## Contributing\n\nContributions are always welcome! Please run `npm test` beforehand to ensure everything is ok.\n\n## Support\n\nIf you use this package please consider starring it :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falvarocastro%2Fround","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falvarocastro%2Fround","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falvarocastro%2Fround/lists"}