Open Monograph Press
3.3.0
|
Public Member Functions | |
__construct ($scale=14) | |
absolute ($number) | |
add ($amount, $addend) | |
ceil ($number) | |
compare ($a, $b) | |
divide ($amount, $divisor) | |
floor ($number) | |
mod ($amount, $divisor) | |
multiply ($amount, $multiplier) | |
round ($number, $roundingMode) | |
share ($amount, $ratio, $total) | |
subtract ($amount, $subtrahend) | |
Static Public Member Functions | |
static | supported () |
Definition at line 12 of file BcMathCalculator.php.
Money\Calculator\BcMathCalculator::__construct | ( | $scale = 14 | ) |
int | $scale |
Definition at line 25 of file BcMathCalculator.php.
Money\Calculator\BcMathCalculator::absolute | ( | $number | ) |
{Returns the absolute value of the number.
string | $number |
Implements Money\Calculator.
Definition at line 126 of file BcMathCalculator.php.
Money\Calculator\BcMathCalculator::add | ( | $amount, | |
$addend | |||
) |
{Add added to amount.
string | $amount | |
string | $addend |
Implements Money\Calculator.
Definition at line 49 of file BcMathCalculator.php.
References Money\Number\fromString().
Money\Calculator\BcMathCalculator::ceil | ( | $number | ) |
{Round number to following integer.
string | $number |
Implements Money\Calculator.
Definition at line 90 of file BcMathCalculator.php.
References Money\Number\fromNumber().
Money\Calculator\BcMathCalculator::compare | ( | $a, | |
$b | |||
) |
{Compare a to b.
string | $a | |
string | $b |
Implements Money\Calculator.
Definition at line 41 of file BcMathCalculator.php.
Money\Calculator\BcMathCalculator::divide | ( | $amount, | |
$divisor | |||
) |
{Divide amount with divisor.
string | $amount | |
int | float | string | $divisor |
Implements Money\Calculator.
Definition at line 80 of file BcMathCalculator.php.
References Money\Number\fromNumber().
Money\Calculator\BcMathCalculator::floor | ( | $number | ) |
{Round number to preceding integer.
string | $number |
Implements Money\Calculator.
Definition at line 108 of file BcMathCalculator.php.
References Money\Number\fromNumber().
Referenced by Money\Calculator\BcMathCalculator\share().
Money\Calculator\BcMathCalculator::mod | ( | $amount, | |
$divisor | |||
) |
{Get the modulus of an amount.
string | $amount | |
int | float | string | $divisor |
Implements Money\Calculator.
Definition at line 242 of file BcMathCalculator.php.
Money\Calculator\BcMathCalculator::multiply | ( | $amount, | |
$multiplier | |||
) |
{Multiply amount with multiplier.
string | $amount | |
int | float | string | $multiplier |
Implements Money\Calculator.
Definition at line 70 of file BcMathCalculator.php.
References Money\Number\fromNumber().
Money\Calculator\BcMathCalculator::round | ( | $number, | |
$roundingMode | |||
) |
{Round number, use rounding mode for tie-breaker.
int | float | string | $number | |
int | $roundingMode |
Implements Money\Calculator.
Definition at line 134 of file BcMathCalculator.php.
References Money\Number\fromNumber(), Money\Money\ROUND_HALF_DOWN, Money\Money\ROUND_HALF_EVEN, Money\Money\ROUND_HALF_NEGATIVE_INFINITY, Money\Money\ROUND_HALF_ODD, Money\Money\ROUND_HALF_POSITIVE_INFINITY, and Money\Money\ROUND_HALF_UP.
Money\Calculator\BcMathCalculator::share | ( | $amount, | |
$ratio, | |||
$total | |||
) |
{Share amount among ratio / total portions.
string | $amount | |
int | float | string | $ratio | |
int | float | string | $total |
Implements Money\Calculator.
Definition at line 234 of file BcMathCalculator.php.
References Money\Calculator\BcMathCalculator\floor().
Money\Calculator\BcMathCalculator::subtract | ( | $amount, | |
$subtrahend | |||
) |
{Subtract subtrahend from amount.
string | $amount | |
string | $subtrahend |
$amount | |
$subtrahend |
Implements Money\Calculator.
Definition at line 62 of file BcMathCalculator.php.
References Money\Number\fromString().
|
static |
{Returns whether the calculator is supported in the current server environment.
Implements Money\Calculator.
Definition at line 33 of file BcMathCalculator.php.