I'm trying to convert wei to eth by using php and the bc-math extension.
when trying to convert it using this function:
function wei2eth($wei)
{
return bcdiv($wei,1000000000000000000,18);
}
I get the following error:
Warning: bcdiv(): Division by zero in C:\xampp\htdocs\test\coindata.php on line 121
Has anyone used the bc-math extension and bcdiv to convert wei to eth and knows, why I get this error?
Thanks in advance