2017 © Pedro Peláez
 

library divider

Service to divide a given amount into given parts

image

bestform/divider

Service to divide a given amount into given parts

  • Tuesday, December 30, 2014
  • by bestform
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 200 % Grown

The README.md

DIVIDER

Travis Build Status, (*1)

The Divider class can be used to divide a certain amount into smaller parts, that can be defined., (*2)

You can use it for example to divide an amount of money into possible coins and notes. The default parts when instantiating a Divider instance are all possible € coins and notes., (*3)

Example:, (*4)

<?php

$divider = new Divider();
$result = $divider->divide(30); // [20 => 1, 10 => 1]

The class only handles integers, so if you are working with € keep in mind that the input as well as output is considered being cents., (*5)

Divider also handles rest values:, (*6)

<?php

$divider = new Divider([3]);
$result = $divider->divide(4); // [3=>1, "REST" => 1]

The Versions

30/12 2014

dev-master

9999999-dev

Service to divide a given amount into given parts

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

by Matthias Derer