- Sample Codes
Google Currency Converter - How to change number of decimal places for the converted currency?
|Written by kksou|
|Friday, 04 May 2012|
By default, Google returns the converted currency in 4 decimal places. To change to 2 decimal places, all we need to do is to grab the value of the converted currency and use the standard PHP
$data = $app->process();
$data = number_format($data, 2);
This will format the output to 2 decimal places.
|< Prev||Next >|