承接 bestform/divider 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bestform/divider

Composer 安装命令:

composer require bestform/divider

包简介

Service to divide a given amount into given parts

README 文档

README

Travis Build Status

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

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.

Example:

<?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.

Divider also handles rest values:

<?php

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

统计信息

  • 总下载量: 12
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-01-01