PHPackages                             wmde/euro - 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. wmde/euro

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

wmde/euro
=========

Value object for representing a positive amount of Euro

v1.4.0(1y ago)337.3k↓43.8%1[1 issues](https://github.com/wmde/Euro/issues)GPL-2.0-or-laterPHPPHP &gt;=8.4CI passing

Since Jul 31Pushed 2mo ago8 watchersCompare

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

READMEChangelog (3)Dependencies (3)Versions (8)Used By (0)

Euro
====

[](#euro)

[Value Object](https://en.wikipedia.org/wiki/Value_object) that represents a positive amount of Euro.

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

[](#installation)

To add this package as a local, per-project dependency to your project, add a dependency on `wmde/euro` to your project's `composer.json` file. Here is a minimal example of a `composer.json` file that just defines a dependency on Euro 1.x:

```
{
    "require": {
        "wmde/euro": "^1.0.1"
    }
}
```

Usage
-----

[](#usage)

### Construction

[](#construction)

Constructing from Euro cents (int):

```
$productPrice = Euro::newFromCents(4200);
```

Constructing from a Euro amount (float):

```
$productPrice = Euro::newFromFloat(42.00);
```

Constructing from a Euro amount (string):

```
$productPrice = Euro::newFromString('42.00');
```

Constructing from a Euro amount (int):

```
$productPrice = Euro::newFromInt(42);
```

### Access

[](#access)

```
echo $productPrice->getEuroCents();
// 4200 (int) for all above examples
```

```
echo $productPrice->getEuroFloat();
// 42.0 (float) for all above examples
```

```
echo $productPrice->getEuroString();
// "42.00" (string) for all above examples
```

### Comparison

[](#comparison)

```
Euro::newFromCents(4200)->equals(Euro::newFromInt(42));
// true
```

```
Euro::newFromCents(4201)->equals(Euro::newFromInt(42));
// false
```

Running the tests
-----------------

[](#running-the-tests)

For tests only

```
composer test

```

For style checks only

```
composer cs

```

For a full CI run

```
composer ci

```

Release notes
-------------

[](#release-notes)

### 1.1.1 (dev)

[](#111-dev)

- Large numbers now cause an InvalidArgumentException rather than a TypeError

### 1.1.0 (2018-03-21)

[](#110-2018-03-21)

- Bumped minimum PHP version from 7.0 to 7.1

### 1.0.2 (2018-03-20)

[](#102-2018-03-20)

- Internal changes to avoid dealing with floats when constructing an Euro object from string

### 1.0.1 (2018-03-17)

[](#101-2018-03-17)

- Fixed rounding issue occurring on some platforms

### 1.0.0 (2016-07-31)

[](#100-2016-07-31)

- Initial release

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance62

Regular maintenance activity

Popularity32

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity85

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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

Every ~637 days

Recently: every ~647 days

Total

6

Last Release

392d ago

PHP version history (4 changes)1.0.0PHP &gt;=7.0

1.1.0PHP &gt;=7.1

1.3.0PHP &gt;=7.4

v1.4.0PHP &gt;=8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/451bd4039d530fed8f9c3da91bfa519233a397d2182cdfdcad700f6cfea19b7f?d=identicon)[Jeroen De Dauw](/maintainers/Jeroen%20De%20Dauw)

![](https://www.gravatar.com/avatar/054adb441e7ee248ec924bc45fa793835c284710eb31627587fa5de21bab9e96?d=identicon)[wmde](/maintainers/wmde)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (49 commits)")[![JeroenDeDauw](https://avatars.githubusercontent.com/u/146040?v=4)](https://github.com/JeroenDeDauw "JeroenDeDauw (31 commits)")[![gbirke](https://avatars.githubusercontent.com/u/223326?v=4)](https://github.com/gbirke "gbirke (25 commits)")[![moiikana](https://avatars.githubusercontent.com/u/11670701?v=4)](https://github.com/moiikana "moiikana (12 commits)")[![Abban](https://avatars.githubusercontent.com/u/663782?v=4)](https://github.com/Abban "Abban (9 commits)")[![Sperling-0](https://avatars.githubusercontent.com/u/30310702?v=4)](https://github.com/Sperling-0 "Sperling-0 (9 commits)")[![timEulitz](https://avatars.githubusercontent.com/u/4571512?v=4)](https://github.com/timEulitz "timEulitz (4 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/wmde-euro/health.svg)

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

###  Alternatives

[botble/assets

Laravel assets management

47275.1k2](/packages/botble-assets)[codexshaper/laravel-pwa

Laravel Progressive Web App

153.0k](/packages/codexshaper-laravel-pwa)

PHPackages © 2026

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