99designs/money-php

There is no license information available for the latest version (v1.0.0) of this package.

A library for dealing with money and currency conversion.

Installs: 54 324

Dependents: 1

Suggesters: 0

Security: 0

Stars: 10

Watchers: 48

Forks: 6

v1.0.0 2012-10-05 07:44 UTC

This package is not auto-updated.

Last update: 2024-04-13 12:01:33 UTC


README

A library for dealing with money and currency conversion. PHP port of http://money.rubyforge.org

Usage

<?php

require_once 'src/money.php';

// 10.00 USD
$money = new money\Money(1000, 'USD');
$money->cents();     // => 1000
$money->currency();  // => new money\Currency("USD")

Status

This project is still a work in progress.

Things to do:

  • money comparison
  • money arithmetic
  • currency conversion

Contributions welcome. :-)

Tests

Tests are located in the tests subdirectory.

You'll need to install PHPUnit before running the tests: http://www.phpunit.de/manual/3.5/en/installation.html

Then run the tests like this:

phpunit tests

Credits

All credit goes to the creators of the Ruby money library. This is a direct port of the code.

http://money.rubyforge.org/

https://github.com/RubyMoney/money