PHPackages                             rossmitchell/xfi-currency - 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. rossmitchell/xfi-currency

ActiveLibrary

rossmitchell/xfi-currency
=========================

Currency for use with MoneyPHP that handle Financial Prices with fractions of a penny

v0.1.0(6y ago)16GPL-3.0-or-laterPHPPHP &gt;=7.1

Since Jul 7Pushed 6y agoCompare

[ Source](https://github.com/rossmitchell/XfiCurrency)[ Packagist](https://packagist.org/packages/rossmitchell/xfi-currency)[ RSS](/packages/rossmitchell-xfi-currency/feed)WikiDiscussions master Synced today

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

XFI Currency
============

[](#xfi-currency)

XFI Currency is a new currency type for use with [Money PHP](https://github.com/moneyphp/money) that handles values with fractions of pennies.

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

[](#installation)

```
composer require rossmitchell/xfi-currency

```

Rational
--------

[](#rational)

I'm working with financial information related to fund prices. These are returned in fractions of a penny, e.g. 123.45 is £1,23 pence, and 45 centi-pennies. Money PHP doesn't support these natively using GBP as it expects whole pennies only.

To avoid having to remember to convert these each time I need to use the data, this package create a new Currency for use with the Money library that correctly stores the information and then allows the values to be converted between the two currencies.

I'm using the code XFI, as X is used to denoted things which are "similar to currencies" in ISO-4217, FI to stand for Financial Information, and XFI as it has not been assigned in the list yet

Usage
-----

[](#usage)

Using the currency is as simple as using the code, like so

```
