PHP code example of openbuildings / monetary

1. Go to this page and download the library: Download openbuildings/monetary library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

openbuildings / monetary example snippets

 php
echo Monetary::instance()->convert(10, 'USD', 'GBP');
// 7.5091987684914

echo Monetary::instance()->format(15.3, 'GBP');
// £15.30