From c0e706ca11745a4e9ad86e597d7e1cf73248e08c Mon Sep 17 00:00:00 2001 From: jesse77169 <959994066@qq.com> Date: Wed, 28 Jun 2023 17:06:11 +0800 Subject: [PATCH] Update TronAwareTrait.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I can't send any trx with a quantity less than 0.0001. For example: $tron->send('Txxxxxxx', 0.00001); This cannot be sent Modifying the code here can solve this problem --- src/TronAwareTrait.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/TronAwareTrait.php b/src/TronAwareTrait.php index 66711fa..2be76b3 100644 --- a/src/TronAwareTrait.php +++ b/src/TronAwareTrait.php @@ -114,10 +114,10 @@ public function fromTron($amount): float { * Convert float to trx format * * @param $double - * @return int + * @return double */ - public function toTron($double): int { - return (int) bcmul((string)$double, (string)1e6,0); + public function toTron($double) { + return $double; } /** @@ -132,4 +132,4 @@ public function sha3($string, $prefix = true) { return ($prefix ? '0x' : ''). Keccak::hash($string, 256); } -} \ No newline at end of file +}