定制 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
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

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