MoneyAllocator
in package
FinalYes
Распределение суммы по целочисленным долям без потери минорной единицы.
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- allocate() : array<int, Money>
- shares() : array<int, Money>
Properties
$math read-only
private
IntegerMath
$math
Methods
__construct()
public
__construct(IntegerMath $math) : mixed
Parameters
- $math : IntegerMath
allocate()
public
allocate(Money $money, array<int, int> $ratios, RoundingMode $mode) : array<int, Money>
Parameters
- $money : Money
- $ratios : array<int, int>
- $mode : RoundingMode
Tags
Return values
array<int, Money>shares()
private
shares(Money $money, array<int, int> $ratios, int $total, RoundingMode $mode) : array<int, Money>
Parameters
- $money : Money
- $ratios : array<int, int>
- $total : int
- $mode : RoundingMode