PHPackages                             mehmetriza/numbery - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. mehmetriza/numbery

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

mehmetriza/numbery
==================

Php string to number and validation convert function

1.0.0(2y ago)09MITPHPPHP &gt;=7.3

Since Jun 19Pushed 1y ago1 watchersCompare

[ Source](https://github.com/mehmetriza/numbery)[ Packagist](https://packagist.org/packages/mehmetriza/numbery)[ RSS](/packages/mehmetriza-numbery/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (1)Versions (2)Used By (0)

### Php string to number and validation convert function

[](#php-string-to-number-and-validation-convert-function)

install
=======

[](#install)

```
composer require mehmetriza/numbery

```

Usage
=====

[](#usage)

```
require "vendor/autoload.php";

    Numbery::parse("$1.000,00 adam") // string number
        ->decimal(2,true) // decimal count, optional (true|false)
        ->decimalSeparator(',') // using decimal operator
        ->thousandsSeparator('.') // thousand seperator chracter
        ->prefix('$',true) // prefix chracter, is optional (true|false)
        ->suffix(' adam',false) // suffix chracter, is optional (true|false)
        ->convert(); //return double
```

Example 1
---------

[](#example-1)

```
    $a = '$123,45 adam';

    Numbery::parse($a)
        ->decimal(2,true)
        ->decimalSeparator(',')
        ->thousandsSeparator('.')
        ->prefix('$',true)
        ->suffix(' adam',false)
        ->convert();

    // return 123.45 -> double
```

Example 2
---------

[](#example-2)

```
$a = "100.855.555";

Numbery::parse($a)
    ->decimal(5,true)
    ->thousandsSeparator('.')
    ->convert();

// return 100855555 -> double
```

if you want the return data type integer

```
$value = int Numbery::parse($a)
    ->decimal(5,true)
    ->thousandsSeparator('.')
    ->convert();
```

Exceptions
----------

[](#exceptions)

```
throws an error if it doesn't conform to conditions

```

```
new NumericException;
new DecimalException;
new PrefixException;
new SuffixException;
new ThousandException;
```

###  Health Score

20

—

LowBetter than 17% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

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

1007d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8eca537ec7db4a5fb7e7aa84ee3196d7a2f734fdeee4e0cd6a8ea73775fc1351?d=identicon)[mehmetriza](/maintainers/mehmetriza)

---

Tags

librarynumber-converterphpvalidationnumber convertphp-numbernumber validationstring numberstring convertcheck number

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mehmetriza-numbery/health.svg)

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

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k882.5M1.0k](/packages/webmozart-assert)[composer/semver

Version comparison library that offers utilities, version constraint parsing and validation.

3.3k479.5M567](/packages/composer-semver)[respect/validation

The most awesome validation engine ever created for PHP

5.9k36.6M349](/packages/respect-validation)[propaganistas/laravel-phone

Adds phone number functionality to Laravel based on Google's libphonenumber API.

3.0k34.5M83](/packages/propaganistas-laravel-phone)[laminas/laminas-escaper

Securely and safely escape HTML, HTML attributes, JavaScript, CSS, and URLs

21986.9M118](/packages/laminas-laminas-escaper)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.2M67](/packages/swaggest-json-schema)

PHPackages © 2026

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