Skip to content Skip to sidebar Skip to footer

Is There Any PHP Function To Convert Number To Currency With Thousands Separators?

Is there any PHP function to convert an integer to Lakh and Crore? 900800 -> 9,00,800 500800 -> 5,00,800

Solution 1:

As you have added Yii in your question tags, you can do this in Yii's way like below:

Yii::app()->language='en_IN';
// Output: Lakh 9,00,800
echo Yii::app()->numberFormatter->formatCurrency('900800', 'Lakh');

// Output: ₹ 5,00,800
echo Yii::app()->numberFormatter->formatCurrency('500800', 'INR');

Solution 2:


Post a Comment for "Is There Any PHP Function To Convert Number To Currency With Thousands Separators?"