<?php
string bcmul ( string $num1 ,
string $num2,
?int $scale = null )
where,
$num1 = The dividend as STRING
$num2 = The divisor as STRING
$scale = The number of decimal places
considered by this operation
?>
<?php
$vl01a = 2020.106;
$vl01b = 0.237;
$vl01c = 0;
$sc01a = 0;
$sc01b = 10;
$bca01a = bcdiv($vl01a, $vl01b);
$bca01b1 = bcdiv($vl01a, $vl01b, $sc01a);
$bca01b2 = bcdiv($vl01a, $vl01b, $sc01b);
$bca01b3 = bcdiv($vl01a, $vl01c, $sc01b);
echo 'bcdiv( ' . $vl01a . ', ' . $vl01b . ' ) = ' . $bca01a .
'<br>[ NO SCALE IS PROVIDED ]<br><br>';
echo 'bcdiv( ' . $vl01a . ', ' . $vl01b . ', ' . $sc01a . ' ) = ' . $bca01b1 .
'<br>[ SCALE = ' . $sc01a . ' ]<br><br>';
echo 'bcdiv( ' . $vl01a . ', ' . $vl01b . ', ' . $sc01b . ' ) = ' . $bca01b2 .
'<br> [ SCALE = ' . $sc01b . ' ]<br><br>';
echo 'bcdiv( ' . $vl01a . ', ' . $vl01c . ', ' . $sc01b . ' ) = ' . $bca01b3 .
'<br> [ SCALE = ' . $sc01b . ' ]<br><br>';
?>