peteboere/css-crush — Issue #21: Missing bcdiv() function
Author: lencioni
Created: 2012-02-01 21:12:12+00:00
State: open

When I try to use the percent function like this:

property: percent( 200, 960 );

I see the following fatal error:

Fatal error: Call to undefined function bcdiv() in /path/to/css-crush/lib/Function.php on line 255

I'm guessing it is because we don't have the BCMath extension enabled. What do you think of possibly adding this function if it is missing ([as suggested in this comment](http://www.php.net/manual/en/function.bcdiv.php#84255))?

if( !function_exists( "bcdiv" ) )
{
function bcdiv( $first, $second, $scale = 0 )
{
$res = $first / $second;
return round( $res, $scale );
}
}