Top Ad unit 728 × 90

convert amount in indian rs format


//Start to convert amount in indian rs format....
$amount=round('123456', 0);
$amount=$amount . ".00";
$amount<0?(($sign='-').($amount*=-1)):$sign='';
if($pos=strpos($amount, '.'))
{
    $dec= substr($amount, $pos);
    $amount=substr($amount,0, $pos);
}
else $dec='';
$amt=  substr($amount, -3);
$amount=  substr($amount,0, -3);

for(;strlen($amount);$amount=substr($amount,0,-2))
    $amt=substr ($amount,-2).','.$amt;
echo $sign.$amt.$dec;
//end to convert amount in indian rs format....

It will output like 1,23,456.00
convert amount in indian rs format Reviewed by Ashok Sen on 01:05:00 Rating: 5

No comments:

Website Design Company at Kolkata All Rights Reserved © 2014 - 2019
Developed by Asenwebmedia

Contact Form

Name

Email *

Message *

Powered by Blogger.