PHP code example of trendsoft / capital

1. Go to this page and download the library: Download trendsoft/capital 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/ */

    

trendsoft / capital example snippets


( new Money( 0.001 ) )->toCapital(); //零元
( new Money( 0.005 ) )->toCapital(); //壹分
( new Money( 0.01 ) )->toCapital(); //壹分
( new Money( 0.10 ) )->toCapital(); //壹角
( new Money( 0.105 ) )->toCapital(); //壹角壹分
( new Money( 0.11 ) )->toCapital(); //壹角壹分
( new Money( 0.15 ) )->toCapital(); //壹角伍分
( new Money( 1.01 ) )->toCapital(); //壹元零壹分
( new Money( 10.01 ) )->toCapital(); //壹拾元零壹分
( new Money( 0.09 ) )->toCapital(); //玖分
( new Money( 1.0 ) )->toCapital(); //壹元
( new Money( 1.1 ) )->toCapital(); //壹元壹角
( new Money( 2.0 ) )->toCapital(); //贰元
( new Money( 2.1 ) )->toCapital(); //贰元壹角