PHPackages                             padmission/number-no-intl - 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. padmission/number-no-intl

ActiveLibrary

padmission/number-no-intl
=========================

A Laravel package that automatically replaces the default Laravel Number class with a version that doesn't require the intl extension.

v0.1(1y ago)04MITPHPPHP ^8.3CI passing

Since May 6Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Padmission/number-no-intl)[ Packagist](https://packagist.org/packages/padmission/number-no-intl)[ Docs](https://github.com/padmission/number-no-intl)[ RSS](/packages/padmission-number-no-intl/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (10)Versions (2)Used By (0)

Laravel Number Without Intl Extension
=====================================

[](#laravel-number-without-intl-extension)

[![Latest Version on Packagist](https://camo.githubusercontent.com/306fce2f449f745b67f161f8e01b4224379e8c399ff1b958a6fbdd46008f0ed7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7061646d697373696f6e2f6e756d6265722d6e6f2d696e746c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/padmission/number-no-intl)[![GitHub Tests Action Status](https://camo.githubusercontent.com/291b8973e594b2a5acaeba055703639b98865fac03cdcf55e718c26bba9bca20/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7061646d697373696f6e2f6e756d6265722d6e6f2d696e746c2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/padmission/number-no-intl/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/0f2a43d8ed27638735a9b7fa14c0d84e06763d7d6ecba81a64a9d32488f1aaba/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7061646d697373696f6e2f6e756d6265722d6e6f2d696e746c2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/padmission/number-no-intl/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/b41576c757232ba23dbea406818bda9687b4a7c2eb90f8b72c02da8a01a2c10e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7061646d697373696f6e2f6e756d6265722d6e6f2d696e746c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/padmission/number-no-intl)

A Laravel package that automatically replaces the default Laravel Number class with a version that doesn't require the PHP intl extension. This is particularly useful for environments where the intl extension cannot be installed or is unavailable.

Important Note
--------------

[](#important-note)

**This package only fully supports the English ('en') locale.** When using other locales, the formatting will still work, but text-based methods like `spell()` and `spellOrdinal()` will fall back to the English implementation or basic number formatting. This is a limitation of the implementation without the intl extension.

Features
--------

[](#features)

- **Zero Configuration**: Once installed, automatically replaces Laravel's Number class when the intl extension is not available
- **Fully Compatible**: Implements all the methods from Laravel's original Number class
- **Smart Detection**: Only activates when needed (when intl extension is not available)
- **Symfony Polyfill**: Uses the Symfony polyfill for intl-icu to provide compatibility
- **English-Only**: Full functionality is available in the English locale, with limited support for other locales

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

[](#installation)

You can install the package via composer:

```
composer require padmission/number-no-intl
```

That's it! No additional configuration is needed. The package will automatically detect if the intl extension is missing and replace Laravel's Number class accordingly.

Usage
-----

[](#usage)

Use Laravel's Number class as you normally would. The package will transparently replace it if the intl extension is not available:

```
use Illuminate\Support\Number;

// Format a number
echo Number::format(1234.56, 2); // "1,234.56"

// Format as currency
echo Number::currency(1234.56, 'USD'); // "$1,234.56"

// Format as percentage
echo Number::percentage(75.5); // "76%"

// Format for humans
echo Number::forHumans(1234567); // "1.23 million"

// Format abbreviated
echo Number::abbreviate(1234567); // "1.23M"
```

All other methods from Laravel's Number class are also available:

- `spell()`: Spell out a number in words (e.g., "one hundred and twenty-three") - **English only**
- `ordinal()`: Convert a number to its ordinal form (e.g., 1st, 2nd, 3rd) - **English only**
- `spellOrdinal()`: Spell out a number in ordinal form (e.g., "first", "second", "third") - **English only**
- `fileSize()`: Convert bytes to a human-readable file size
- `clamp()`: Clamp a number between min and max values
- `pairs()`: Split a number into pairs of min/max values
- `trim()`: Remove trailing zeros from a number
- `withLocale()`: Execute a callback with a specific locale
- `withCurrency()`: Execute a callback with a specific currency
- `useLocale()`: Set the default locale
- `useCurrency()`: Set the default currency
- `defaultLocale()`: Get the current default locale
- `defaultCurrency()`: Get the current default currency

Locale Support Limitations
--------------------------

[](#locale-support-limitations)

While the package allows you to set different locales using `useLocale()` or `withLocale()`, be aware of these limitations:

1. Text-based methods (`spell()`, `ordinal()`, `spellOrdinal()`) only fully work in English
2. For non-English locales, text-based methods will either:
    - Fall back to the English implementation
    - Or return basic formatted numbers instead of text
3. Basic formatting functions (`format()`, `currency()`, `percentage()`, etc.) work for all locales, but use standard English number formatting conventions (comma as thousands separator, period as decimal separator)

If you need full multi-language support, consider:

1. Installing the PHP intl extension if possible
2. Or implementing language-specific formatters for your required languages

Configuration
-------------

[](#configuration)

While the package works out of the box with zero configuration, you can publish the configuration file to customize its behavior:

```
php artisan vendor:publish --tag="number-no-intl-config"
```

This will create a `config/number-no-intl.php` file with the following options:

```
return [
    // Default locale to use for formatting (only 'en' is fully supported)
    'locale' => env('NUMBER_NO_INTL_LOCALE', 'en'),

    // Default currency to use
    'currency' => env('NUMBER_NO_INTL_CURRENCY', 'USD'),

    // Whether to automatically replace Laravel's Number class
    // when the intl extension is not available
    'auto_replace' => env('NUMBER_NO_INTL_AUTO_REPLACE', true),
];
```

How It Works
------------

[](#how-it-works)

The package uses the following approach:

1. When your application boots, it checks if the intl extension is installed
2. If intl is available, by default the package does nothing and allows Laravel to use its built-in Number class
3. If intl is not available, the package automatically binds a polyfill implementation that uses the Symfony polyfill for intl-icu

This ensures that your application works seamlessly across environments, regardless of whether the intl extension is installed or not.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Kevin McKee](https://github.com/)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance49

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

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

371d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c2465b1648310aaeaabcb11b1ffc4a5f9bf8389b3751876b0752d7d4e33f1251?d=identicon)[iamkevinmckee](/maintainers/iamkevinmckee)

---

Top Contributors

[![iAmKevinMcKee](https://avatars.githubusercontent.com/u/4503765?v=4)](https://github.com/iAmKevinMcKee "iAmKevinMcKee (2 commits)")

---

Tags

laravelPadmissionnumber-no-intl

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/padmission-number-no-intl/health.svg)

```
[![Health](https://phpackages.com/badges/padmission-number-no-intl/health.svg)](https://phpackages.com/packages/padmission-number-no-intl)
```

###  Alternatives

[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[spatie/laravel-prometheus

Export Laravel metrics to Prometheus

2651.3M6](/packages/spatie-laravel-prometheus)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)

PHPackages © 2026

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