{"id":22808282,"url":"https://github.com/sixarm/sixarm_ruby_numeric_round","last_synced_at":"2025-03-30T21:15:33.964Z","repository":{"id":3449323,"uuid":"4502636","full_name":"SixArm/sixarm_ruby_numeric_round","owner":"SixArm","description":"SixArm.com » Ruby » Numeric #round, #floor, #ceil methods with precision","archived":false,"fork":false,"pushed_at":"2023-09-15T19:28:40.000Z","size":339,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-06T00:24:57.926Z","etag":null,"topics":["extensions","gem","numeric","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SixArm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null}},"created_at":"2012-05-31T01:36:06.000Z","updated_at":"2023-05-22T14:12:16.000Z","dependencies_parsed_at":"2022-09-08T12:30:33.419Z","dependency_job_id":null,"html_url":"https://github.com/SixArm/sixarm_ruby_numeric_round","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SixArm%2Fsixarm_ruby_numeric_round","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SixArm%2Fsixarm_ruby_numeric_round/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SixArm%2Fsixarm_ruby_numeric_round/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SixArm%2Fsixarm_ruby_numeric_round/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SixArm","download_url":"https://codeload.github.com/SixArm/sixarm_ruby_numeric_round/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246379366,"owners_count":20767696,"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":["extensions","gem","numeric","ruby"],"created_at":"2024-12-12T11:08:56.908Z","updated_at":"2025-03-30T21:15:33.936Z","avatar_url":"https://github.com/SixArm.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SixArm.com → Ruby → \u003cbr\u003e Numeric #round, #floor, #ceil methods with precision\n\n\u003c!--header-open--\u003e\n\n[![Gem Version](https://badge.fury.io/rb/sixarm_ruby_numeric_round.svg)](http://badge.fury.io/rb/sixarm_ruby_numeric_round)\n[![Build Status](https://travis-ci.org/SixArm/sixarm_ruby_numeric_round.png)](https://travis-ci.org/SixArm/sixarm_ruby_numeric_round)\n[![Code Climate](https://api.codeclimate.com/v1/badges/1cf9d84964d38caab79a/maintainability)](https://codeclimate.com/github/SixArm/sixarm_ruby_numeric_round/maintainability)\n\n* Git: \u003chttps://github.com/SixArm/sixarm_ruby_numeric_round\u003e\n* Doc: \u003chttp://sixarm.com/sixarm_ruby_numeric_round/doc\u003e\n* Gem: \u003chttps://rubygems.org/gems/sixarm_ruby_numeric_round\u003e\n* Contact: Joel Parker Henderson, \u003cjoel@sixarm.com\u003e\n* Project: [changes](CHANGES.md), [license](LICENSE.md), [contributing](CONTRIBUTING.md).\n\n\u003c!--header-shut--\u003e\n\n\n## Introduction\n\nSimple numeric rounding methods like #round, #floor, #ceil with various precisions.\n\nFor docs go to \u003chttp://sixarm.com/sixarm_ruby_numeric_round/doc\u003e\n\nWant to help? We're happy to get pull requests.\n\n\n\u003c!--install-open--\u003e\n\n## Install\n\n### Gem\n\nTo install this gem in your shell or terminal:\n\n    gem install sixarm_ruby_numeric_round\n\n### Gemfile\n\nTo add this gem to your Gemfile:\n\n    gem 'sixarm_ruby_numeric_round'\n\n### Require\n\nTo require the gem in your code:\n\n    require 'sixarm_ruby_numeric_round'\n\n\u003c!--install-shut--\u003e\n\n\n## Examples\n\nRound at a given decimal point:\n\n    4.555.ceil_at(1)  #=\u003e 4.6\n    4.555.floor_at(1)  #=\u003e 4.5\n    4.555.round_at(1)  #=\u003e 4.6\n    4.555.truncate_at(1)  #=\u003e 4.5\n\nRound to a given precision:\n\n    4.555.ceil_to(0.1)   #=\u003e 4.6\n    4.555.floor_to(0.1)  #=\u003e 4.5\n    4.555.round_to(0.1)  #=\u003e 4.6\n    4.555.truncate_to(0.1)  #=\u003e 4.5\n\nConceptually, the methods for round, floor, ceil, and truncate will typically be for floating point numbers.\nHowever, these methods can actually be for pretty much any Numeric object.\nFor example, one could round an Integer to the nearest kilo.\n\n\n## Credit\n\nThese methods are based on the Facets library for Ruby and the developer named Trans. \n\nThe #round_at and #round_to methods are exact copies and fully compatible with Facets. The rest of the methods are very similar code and fully co-existant with Facets. \n\nWe're asking the Facets team to consider including the rest of the methods.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsixarm%2Fsixarm_ruby_numeric_round","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsixarm%2Fsixarm_ruby_numeric_round","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsixarm%2Fsixarm_ruby_numeric_round/lists"}