Download the PHP package vgpastor/discounts-calculator without Composer
On this page you can find all versions of the php package vgpastor/discounts-calculator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download vgpastor/discounts-calculator
More information about vgpastor/discounts-calculator
Files in vgpastor/discounts-calculator
Download vgpastor/discounts-calculator
More information about vgpastor/discounts-calculator
Files in vgpastor/discounts-calculator
Vendor vgpastor
Package discounts-calculator
Short Description Helper library to manage different types of discounts and calculate the relational data
License MIT
Package discounts-calculator
Short Description Helper library to manage different types of discounts and calculate the relational data
License MIT
Please rate this library. Is it a good library?
Informations about the package discounts-calculator
DiscountsCalculator
Helper library for calculating discounts in a application.
Installation
This library are developed to PHP 8.1, use Enum so it's not possible using in previously versions, if you like you can put a PR to make compatible with previous versions..
Usage
Yo can see how to use in example.php file.
Required parameter are
- $type: Type of discount. Can be 'percentage' or 'amount' and based in base amount or in total amount (see DiscountTypeEnum)
- $base (float) - Base price
- $discount (float) - Discount percentage or amount
Optional parameters are
- $tax (float) - Tax percentage By default is 0%
- $precision (int) - Precision of the result. By default is 2
- $roundingMode (int) - Rounding mode. By default is PHP_ROUND_HALF_UP
All versions of discounts-calculator with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.1
The package vgpastor/discounts-calculator contains the following files
Loading the files please wait ....