mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-06 22:21:42 +00:00
Remove floats.
This commit is contained in:
@@ -363,7 +363,7 @@ class TransactionGroupTransformer extends AbstractTransformer
|
||||
$bill = $this->getBill($journal->bill);
|
||||
|
||||
if (null !== $foreignAmount && null !== $foreignCurrency) {
|
||||
$foreignAmount = number_format((float) $foreignAmount, $foreignCurrency['decimal_places'] ?? 0, '.', '');
|
||||
$foreignAmount = app('steam')->bcround($foreignAmount, $foreignCurrency['decimal_places'] ?? 0);
|
||||
}
|
||||
|
||||
$longitude = null;
|
||||
@@ -393,7 +393,7 @@ class TransactionGroupTransformer extends AbstractTransformer
|
||||
'foreign_currency_symbol' => $foreignCurrency['symbol'],
|
||||
'foreign_currency_decimal_places' => $foreignCurrency['decimal_places'],
|
||||
|
||||
'amount' => number_format((float) $amount, $currency->decimal_places, '.', ''),
|
||||
'amount' => app('steam')->bcround($amount, $currency->decimal_places),
|
||||
'foreign_amount' => $foreignAmount,
|
||||
|
||||
'description' => $journal->description,
|
||||
@@ -461,7 +461,7 @@ class TransactionGroupTransformer extends AbstractTransformer
|
||||
{
|
||||
$result = $journal->transactions->first(
|
||||
static function (Transaction $transaction) {
|
||||
return (float) $transaction->amount < 0;
|
||||
return (float) $transaction->amount < 0; // lame but it works.
|
||||
}
|
||||
);
|
||||
if (null === $result) {
|
||||
@@ -481,7 +481,7 @@ class TransactionGroupTransformer extends AbstractTransformer
|
||||
{
|
||||
$result = $journal->transactions->first(
|
||||
static function (Transaction $transaction) {
|
||||
return (float) $transaction->amount > 0;
|
||||
return (float) $transaction->amount > 0; // lame but it works
|
||||
}
|
||||
);
|
||||
if (null === $result) {
|
||||
|
||||
Reference in New Issue
Block a user