Search code examples
phpformatcurrency

how to convert format of amount to indonaisa rupiah?


we are developing a restaurant system in PHP for indonasia restaurant chain

How i can show the coma-seprated amount in to the Indonasia Rupiah

Normally we are showing the amount in our system as like this 9,000,000

So this amount client want to show as this 9.000.000

is there any pre-defined method to convert in INDONASIA currency format either i have to use custom function to convert ?


Solution

  • http://php.net/manual/en/function.number-format.php

    So in your case it would be something like this:

    $number='9000000';
    echo number_format($number, 0, '', '.');