bitcoin-lib-php
bitcoin-lib-php copied to clipboard
Unnecessary cast in toBTC()
/src/BitcoinLib.php [1011]
public static function toBTC($satoshi)
{
return bcdiv((int)(string)$satoshi, 100000000, 8);
}
Looks like it will silently fail on type overflow with 32-bit integer. bcdiv works with strings. So omiting that cast looks apropriate:
bcdiv((string)$satoshi, 100000000, 8);