Closed pmoore95 closed 2 years ago
Constructor only accepts integer(ish) values e.g.
$15.25 is represented with:
$price = new \Money\Money('1525', new Currency('USD'));
However the round function does not work:
$price->multiply(1 , Money::ROUND_UP);
returns '1525'
As it is considered an integer in all the round functions such as ceil() :
public function ceil($number) { $number = Number::fromNumber($number); if ($number->isInteger()) { return (string) $number; } if ($number->isNegative()) { return bcadd((string) $number, '0', 0); } return bcadd((string) $number, '1', 0); }
And just returns the same string. This function works if the parameter is "15.25" but this isn't allowed in the constructor.
Never mind, this isn't an issue apologies.
Constructor only accepts integer(ish) values e.g.
$15.25 is represented with:
$price = new \Money\Money('1525', new Currency('USD'));
However the round function does not work:
$price->multiply(1 , Money::ROUND_UP);
returns '1525'
As it is considered an integer in all the round functions such as ceil() :