@@ -28,7 +28,7 @@ trait HasWalletFloat
2828 public function forceWithdrawFloat (float $ amount , ?array $ meta = null , bool $ confirmed = true ): Transaction
2929 {
3030 $ decimalPlaces = app (WalletService::class)->decimalPlaces ($ this );
31- return $ this ->forceWithdraw ($ amount * $ decimalPlaces , $ meta , $ confirmed );
31+ return $ this ->forceWithdraw (( int ) round ( $ amount * $ decimalPlaces) , $ meta , $ confirmed );
3232 }
3333
3434 /**
@@ -41,7 +41,7 @@ public function forceWithdrawFloat(float $amount, ?array $meta = null, bool $con
4141 public function depositFloat (float $ amount , ?array $ meta = null , bool $ confirmed = true ): Transaction
4242 {
4343 $ decimalPlaces = app (WalletService::class)->decimalPlaces ($ this );
44- return $ this ->deposit ($ amount * $ decimalPlaces , $ meta , $ confirmed );
44+ return $ this ->deposit (( int ) round ( $ amount * $ decimalPlaces) , $ meta , $ confirmed );
4545 }
4646
4747 /**
@@ -54,7 +54,7 @@ public function depositFloat(float $amount, ?array $meta = null, bool $confirmed
5454 public function withdrawFloat (float $ amount , ?array $ meta = null , bool $ confirmed = true ): Transaction
5555 {
5656 $ decimalPlaces = app (WalletService::class)->decimalPlaces ($ this );
57- return $ this ->withdraw ($ amount * $ decimalPlaces , $ meta , $ confirmed );
57+ return $ this ->withdraw (( int ) round ( $ amount * $ decimalPlaces) , $ meta , $ confirmed );
5858 }
5959
6060 /**
@@ -64,7 +64,7 @@ public function withdrawFloat(float $amount, ?array $meta = null, bool $confirme
6464 public function canWithdrawFloat (float $ amount ): bool
6565 {
6666 $ decimalPlaces = app (WalletService::class)->decimalPlaces ($ this );
67- return $ this ->canWithdraw ($ amount * $ decimalPlaces );
67+ return $ this ->canWithdraw (( int ) round ( $ amount * $ decimalPlaces) );
6868 }
6969
7070 /**
@@ -77,7 +77,7 @@ public function canWithdrawFloat(float $amount): bool
7777 public function transferFloat (Wallet $ wallet , float $ amount , ?array $ meta = null ): Transfer
7878 {
7979 $ decimalPlaces = app (WalletService::class)->decimalPlaces ($ this );
80- return $ this ->transfer ($ wallet , $ amount * $ decimalPlaces , $ meta );
80+ return $ this ->transfer ($ wallet , ( int ) round ( $ amount * $ decimalPlaces) , $ meta );
8181 }
8282
8383 /**
@@ -89,7 +89,7 @@ public function transferFloat(Wallet $wallet, float $amount, ?array $meta = null
8989 public function safeTransferFloat (Wallet $ wallet , float $ amount , ?array $ meta = null ): ?Transfer
9090 {
9191 $ decimalPlaces = app (WalletService::class)->decimalPlaces ($ this );
92- return $ this ->safeTransfer ($ wallet , $ amount * $ decimalPlaces , $ meta );
92+ return $ this ->safeTransfer ($ wallet , ( int ) round ( $ amount * $ decimalPlaces) , $ meta );
9393 }
9494
9595 /**
@@ -101,7 +101,7 @@ public function safeTransferFloat(Wallet $wallet, float $amount, ?array $meta =
101101 public function forceTransferFloat (Wallet $ wallet , float $ amount , ?array $ meta = null ): Transfer
102102 {
103103 $ decimalPlaces = app (WalletService::class)->decimalPlaces ($ this );
104- return $ this ->forceTransfer ($ wallet , $ amount * $ decimalPlaces , $ meta );
104+ return $ this ->forceTransfer ($ wallet , ( int ) round ( $ amount * $ decimalPlaces) , $ meta );
105105 }
106106
107107 /**
0 commit comments