Patch correct-ceil-dec-function for *Math Functions Bug #62538
Patch version 2012-07-12 07:25 UTC
Return to Bug #62538 |
Download this patch
Patch Revisions:
Developer: soneta.kumar@gmail.com
function ceil_dec($number,$precision,$separator='.')
{
$appendZero = false;
$numberpart=explode($separator,$number);
$numberpart[1]=substr_replace($numberpart[1],$separator,$precision,0);
if($numberpart[1][0] == 0) { $appendZero = true;}
if($numberpart[0]>=0)
{$numberpart[1]=ceil($numberpart[1]);}
else
{$numberpart[1]=floor($numberpart[1]);}
if($appendZero){ $numberpart[1] = (int) '0'.$numberpart[1];}
$ceil_number= array($numberpart[0],$numberpart[1]);
return implode($separator,$ceil_number);
}
|