PHPackages                             krzysztofzylka/price - 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. krzysztofzylka/price

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

krzysztofzylka/price
====================

Price library

3.0.1(2mo ago)031↓50%MITPHPPHP &gt;=8.2

Since Dec 4Pushed 2mo ago1 watchersCompare

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

READMEChangelog (5)Dependencies (2)Versions (9)Used By (0)

Install
=======

[](#install)

```
composer require krzysztofzylka/price
```

Methods
=======

[](#methods)

Price
-----

[](#price)

### Global default currency

[](#global-default-currency)

```
\Krzysztofzylka\Price\Price::$currency = NULL;
```

### Initialize

[](#initialize)

Initialize with 50.00

```
$price = \Krzysztofzylka\Price\Price::of(50)
```

### Add tax rate

[](#add-tax-rate)

Add 23% tax rate

```
$price->plusTaxRate(23);
```

### Add price

[](#add-price)

Add 150.00 price

```
$price->plus(150);
```

### Subtract price

[](#subtract-price)

Subtract 100 price

```
$price->minus(100);
```

### Get amount

[](#get-amount)

```
echo $price->getAmount();
//173
```

### Get format amount

[](#get-format-amount)

```
echo $price->getFormatAmount('EUR');
//173,00 EUR
```

Calculate
---------

[](#calculate)

### Format amount

[](#format-amount)

```
\Krzysztofzylka\Price\Calculate::formatAmount(100, 'PLN');
// 100,00 PLN
```

### Calculate vat amount

[](#calculate-vat-amount)

```
\Krzysztofzylka\Price\Calculate::calculateVatAmount($amount, $vat)
```

### Calculate net amount

[](#calculate-net-amount)

```
\Krzysztofzylka\Price\Calculate::calculateNetAmount($grossAmount, $vatRate)
```

### Calculate gross amount

[](#calculate-gross-amount)

```
\Krzysztofzylka\Price\Calculate::calculateGrossAmount($netAmount, $vatRate)
```

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance86

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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

Every ~163 days

Recently: every ~199 days

Total

6

Last Release

70d ago

Major Versions

1.0.1 → 2.0.02024-02-07

2.0.0 → 3.0.0.x-dev2024-12-16

PHP version history (3 changes)1.0.0PHP &gt;=7.4

2.0.0PHP &gt;=8.1

3.0.0PHP &gt;=8.2

### Community

Maintainers

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

---

Top Contributors

[![krzysztofzylka](https://avatars.githubusercontent.com/u/41385342?v=4)](https://github.com/krzysztofzylka "krzysztofzylka (10 commits)")

### Embed Badge

![Health badge](/badges/krzysztofzylka-price/health.svg)

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

###  Alternatives

[ramsey/uuid

A PHP library for generating and working with universally unique identifiers (UUIDs).

12.6k700.2M3.3k](/packages/ramsey-uuid)[brick/money

Money and currency library

1.9k37.9M102](/packages/brick-money)[pascaldevink/shortuuid

PHP 7.4+ library that generates concise, unambiguous, URL-safe UUIDs

5951.8M15](/packages/pascaldevink-shortuuid)[flow-php/etl

PHP ETL - Extract Transform Load - Abstraction

374468.4k51](/packages/flow-php-etl)[blair2004/nexopos

The Free Modern Point Of Sale System build with Laravel, TailwindCSS and Vue.js.

1.2k2.3k](/packages/blair2004-nexopos)[spomky-labs/cbor-php

CBOR Encoder/Decoder for PHP

576.4M30](/packages/spomky-labs-cbor-php)

PHPackages © 2026

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