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 2y ago1 watchersCompare

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

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

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity39

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

1058d 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.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

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