From 286590d352889f7048f3e49fdb31111a6eb7b218 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 29 Aug 2023 15:41:05 +0800 Subject: [PATCH] 1 --- webapp/services/BlockChainService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/services/BlockChainService.php b/webapp/services/BlockChainService.php index b3a36a33..c465e4c7 100644 --- a/webapp/services/BlockChainService.php +++ b/webapp/services/BlockChainService.php @@ -215,8 +215,8 @@ class BlockChainService { if (strlen($val) <= $decimals) { $floatPart = $val; } else { - $intPart = substr($val, 0, $decimals); - $floatPart = substr($val, $decimals); + $intPart = substr($val, 0, strlen($val) - $decimals); + $floatPart = substr($val, strlen($val) - $decimals); } return true; }