Skip to content

Commit 1a332e3

Browse files
keatliang2005rez1dent3
authored andcommitted
Fix transaction amount_float mutator
I have notice the mutator on the transaction model display somewhat funky. example i had the wallet set to 4 decimal precision, when access with `$model->amount_float` i had `"0.0120000000000000000000000000000000000000000000000000000000000000"` as result when i made changes above (on PR) it display correctly `"0.0120"`
1 parent 7ca6a71 commit 1a332e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Models/Transaction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function getAmountFloatAttribute(): string
9090
->decimal_places;
9191
$decimalPlaces = $math->powTen($decimalPlacesValue);
9292

93-
return $math->div($this->amount, $decimalPlaces);
93+
return $math->div($this->amount, $decimalPlaces, $decimalPlacesValue);
9494
}
9595

9696
public function setAmountFloatAttribute(float|int|string $amount): void

0 commit comments

Comments
 (0)