diff --git a/webapp/services/BlockChainService.php b/webapp/services/BlockChainService.php index 701b2ec9..5139d8de 100644 --- a/webapp/services/BlockChainService.php +++ b/webapp/services/BlockChainService.php @@ -204,8 +204,17 @@ class BlockChainService { } } - public static function parseCurrency($currencyName, $val, &$intVal, &$floatVal) + public static function parseCurrencyVal($currencyName, $val, &$intVal, &$floatVal) { + $decimals = self::getCurrencyDecimals($currencyName); + $intVal = '0'; + $floatVal = '0'; + if (strlen($val) <= $decimals) { + $floatVal = $val; + } else { + $intVal = substr($val, 0, $decimals); + $floatVal = substr($val, $decimals); + } } /*