PHPackages                             thetestcoder/gst-calculator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. thetestcoder/gst-calculator

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

thetestcoder/gst-calculator
===========================

this is simple gst calculator

v1.0.1(3y ago)064MITPHP

Since Jun 23Pushed 3y ago1 watchersCompare

[ Source](https://github.com/thetestcoder/gst-calculator)[ Packagist](https://packagist.org/packages/thetestcoder/gst-calculator)[ RSS](/packages/thetestcoder-gst-calculator/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

GST Calculator
==============

[](#gst-calculator)

Description
-----------

[](#description)

thetestcoder/gst-calculator is a PHP package that provides a GST (Goods and Services Tax) calculator. It allows you to calculate the GST amount based on a given rate and a provided value. The package is designed to be easily integrated into your PHP projects.

Features
--------

[](#features)

- Calculate GST amount based on rate and value.
- Handle exceptions for invalid values.

Installation
------------

[](#installation)

You can install the package via Composer. Run the following command in your terminal:

```
composer require thetestcoder/gst-calculator
```

Usage
-----

[](#usage)

### Initializing the Package

[](#initializing-the-package)

To use the package, you need to first initialize it and provide the GST rate:

```
use Thetestcoder\GstCalculator;

require "./vendor/autoload.php";

$gst_calculator = new GstCalculator(18.0);
```

### Example Usage

[](#example-usage)

Here's an example of how you can use the package to calculate the GST amount:

```
try {
    $gstAmount = $gst_calculator->calculate(1000);
    echo "GST Amount: " . $gstAmount;
} catch (\Exception $e) {
    echo $e->getMessage();
}
```

In this example, the GST rate is set to 18.0%. The `calculate()` method is called with a value of 1000, and the calculated GST amount is displayed.

### Exception Handling

[](#exception-handling)

The package handles exceptions for invalid values. If the value passed to the `calculate()` method is negative, an exception will be thrown. You can catch the exception and handle it accordingly.

Testing
-------

[](#testing)

The package comes with a set of unit tests to ensure its stability and functionality. You can run the tests using the following command:

```
vendor/bin/phpunit
```

Contributing
------------

[](#contributing)

Contributions are welcome! If you encounter any issues or have suggestions for improvements, please create an issue in the [issue tracker](https://github.com/thetestcoder/gst-calculator/issues/new). If you'd like to contribute code, please follow these guidelines:

1. Fork the repository.
2. Create a new branch for your feature/bug fix.
3. Commit your changes and push them to your branch.
4. Submit a pull request.

Please ensure that your code adheres to the existing coding style and is well-documented.

License
-------

[](#license)

This package is open-source and available under the [MIT License](https://opensource.org/licenses/MIT).

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1106d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/45e905b567fc12b29a159939bae8c391864ba2f1493676c720b4a3e987726ae5?d=identicon)[thetestcoder](/maintainers/thetestcoder)

---

Top Contributors

[![thetestcoder](https://avatars.githubusercontent.com/u/67789776?v=4)](https://github.com/thetestcoder "thetestcoder (7 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/thetestcoder-gst-calculator/health.svg)

```
[![Health](https://phpackages.com/badges/thetestcoder-gst-calculator/health.svg)](https://phpackages.com/packages/thetestcoder-gst-calculator)
```

###  Alternatives

[mtdowling/supervisor-event

Wires callback functions to Supervisor events

124178.6k1](/packages/mtdowling-supervisor-event)[typo3/cms-impexp

TYPO3 CMS Import/Export - Tool for importing and exporting records using XML or the custom T3D format.

106.8M86](/packages/typo3-cms-impexp)[tourze/workerman-yii2

541.3k](/packages/tourze-workerman-yii2)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
