我有一个关于格式化卢比货币(印度卢比-印度卢比)的问题。
例如,这里的数字表示为:
1
10
100
1,000
10,000
1,00,000
10,00,000
1,00,00,000
10,00,00,000
参考Indian Numbering System
我不得不用PHP解决这个问题。
我已经看到了这个问题Displaying Currency in Indian Numbering Format。但是我的问题是不能在PHP中得到它。
更新:
如何在印度货币格式中使用money_format()?
发布于 2015-04-06 21:21:38
$r=explode('.',12345601.20);
$n = $r[0];
$len = strlen($n); //lenght of the no
$num = substr($n,$len-3,3); //get the last 3 digits
$n = $n/1000; //omit the last 3 digits already stored in $num
while($n > 0) //loop the process - further get digits 2 by 2
{
$len = strlen($n);
$num = substr($n,$len-2,2).",".$num;
$n = round($n/100);
}
echo "Rs.".$num.'.'.$r[1];
https://stackoverflow.com/questions/10042485
复制相似问题