PHPackages                             jnjxp/rinc - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jnjxp/rinc

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jnjxp/rinc
==========

Round numbers to increments

0.1.0(9y ago)145MITPHP

Since Jul 22Pushed 9y ago1 watchersCompare

[ Source](https://github.com/jnjxp/jnjxp.rinc)[ Packagist](https://packagist.org/packages/jnjxp/rinc)[ Docs](https://github.com/jnjxp/jnjxp.rinc)[ RSS](/packages/jnjxp-rinc/feed)WikiDiscussions develop Synced 4w ago

READMEChangelogDependenciesVersions (3)Used By (0)

jnjxp.rinc
==========

[](#jnjxprinc)

Round numbers to increments

[![Latest version](https://camo.githubusercontent.com/889f93fe3db3e7105f06b5423978bfa4ec7820eb8abc1b8a022609240e81593a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6e6a78702f72696e632e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jnjxp/rinc)[![Build Status](https://camo.githubusercontent.com/3e4a0a9d2ccd5fe46e82707ad42eb755c182240c058f36e2480e1b5b41570b6e/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6a6e6a78702f6a6e6a78702e72696e632f646576656c6f702e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/jnjxp/jnjxp.rinc)[![Coverage Status](https://camo.githubusercontent.com/076561f4d831f89f9337c4b64a8ec69c5dca9863b587f083ec350a2525de19f3/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6a6e6a78702f6a6e6a78702e72696e632e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/jnjxp/jnjxp.rinc)[![Quality Score](https://camo.githubusercontent.com/2a6b1d7f0effc388049e7e5156536df4595c1f6a433ab47d55fe35696553f216/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6a6e6a78702f6a6e6a78702e72696e632e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/jnjxp/jnjxp.rinc)

Installation
------------

[](#installation)

```
composer require jnjxp/rinc

```

Usage
-----

[](#usage)

```
use Jnjxp\Rinc;

// Rounder
$roundTo = new Rinc\RoundTo;

echo $roundTo->nearest(1/4, 0.24);  // 0.25
echo $roundTo->next(1/4, 0.26);     // 0.5
echo $roundTo->previous(1/4, 0.46); // 0.25

// Increment
$quarter = new Rinc\Increment(1/4);
echo $quarter(0.24);           // 0.25 (same as nearest())
echo $quarter->nearest(0.24);  // 0.25
echo $quarter->next(0.26);     // 0.5
echo $quarter->previous(0.46); // 0.25

// Named Convenience Constructors
$eighth  = Rinc\Increment::eighth();  // new Rinc\Increment(1/8)
$quarter = Rinc\Increment::quarter(); // new Rinc\Increment(1/4)
$half    = Rinc\Increment::half();    // new Rinc\Increment(1/2)
```

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3629d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/64baf5fff415327ccc832998afe54b34ac3c621e401f128a9343d4e0b0a3f9e4?d=identicon)[jnj](/maintainers/jnj)

---

Top Contributors

[![jakejohns](https://avatars.githubusercontent.com/u/174708?v=4)](https://github.com/jakejohns "jakejohns (6 commits)")

### Embed Badge

![Health badge](/badges/jnjxp-rinc/health.svg)

```
[![Health](https://phpackages.com/badges/jnjxp-rinc/health.svg)](https://phpackages.com/packages/jnjxp-rinc)
```

###  Alternatives

[dapr/php-sdk

Dapr Implementation in PHP

7497.0k6](/packages/dapr-php-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
