1. Go to this page and download the library: Download jomweb/ringgit 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/ */
jomweb / ringgit example snippets
use Duit\MYR;
$money = new MYR(540);
$money = MYR::given(540);
$money = MYR::withoutGst(540);
$money = MYR::withoutTax(540);
use Duit\MYR;
use Duit\Taxable\Gst\ZeroRate;
use Duit\Taxable\Gst\StandardRate;
$money = MYR::beforeGst(540);
$money = MYR::beforeTax(540, new StandardRate());
$money = MYR::beforeTax(540, new ZeroRate());
$money = MYR::given(540)->useGstStandardRate(); // 6%
$money = MYR::given(540)->useGstZeroRate(); // 0%
$money = MYR::given(540)->enableTax(new StandardRate());
$money = MYR::given(540)->enableTax(new ZeroRate());
use Duit\MYR;
use Duit\Taxable\Gst\ZeroRate;
use Duit\Taxable\Gst\StandardRate;
$money = MYR::afterGst(530); // always going to use 6%
$money = MYR::afterTax(540, new StandardRate());
$money = MYR::afterTax(540, new ZeroRate());
use Duit\MYR;
$money = new MYR(540);
$money = MYR::given(540);
$money = MYR::withoutTax(540);
use Duit\MYR;
use Duit\Taxable\Sst;
$money = MYR::beforeTax(530, new Sst());
$money = MYR::given(530)->enableTax(new Sst());
use Duit\MYR;
use Duit\Taxable\Sst;
$money = MYR::afterTax(530, new Sst());