Bhagwat Singh

PHP Developer Portfolio

Get Number In 2 Decimal Point.


function formatmoney($Value)
{
$Result = split("[.]", $Value);
$Temp = substr($Result[1],0,2);
$Temp1 = str_pad($Temp,2,"0",STR_PAD_RIGHT);
$FinalResult = $Result[0] .'.'.$Temp1;
return $formatted = number_format($FinalResult, 2);
}

This entry was posted in PHP. Bookmark the permalink.

Site Nevigation