Patch currency subunit conversion (#1484)
* added parentheses around the conversion * updated finance test updated the following test: - journal operations fixed the following tests: - pirep finances - pirep finances specific expense - pirep finances expenses multi airline
This commit is contained in:
@@ -33,7 +33,7 @@ class Money
|
||||
/**
|
||||
* Create from a dollar amount
|
||||
*
|
||||
* @param mixed $amount The amount in pennies
|
||||
* @param mixed $amount The amount in dollar
|
||||
*
|
||||
* @throws \UnexpectedValueException
|
||||
* @throws \InvalidArgumentException
|
||||
@@ -52,12 +52,12 @@ class Money
|
||||
*
|
||||
* @param mixed $amount
|
||||
*
|
||||
* @return float|int
|
||||
* @return int
|
||||
*/
|
||||
public static function convertToSubunit($amount)
|
||||
{
|
||||
$currency = setting('units.currency', 'USD');
|
||||
return (int) $amount * config('money.'.$currency.'.subunit');
|
||||
return (int) ($amount * config('money.'.$currency.'.subunit'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user