Giter Site home page Giter Site logo

ramazancetinkaya / percentage-calculator Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 16 KB

This library provides functions for percentage calculations.

License: MIT License

PHP 100.00%
percentage-calculations percentage-calculator php php8 yuzde-hesaplama yuzde-hesaplayici

percentage-calculator's Introduction

Percentage Calculator Library

License Latest Version PHP GitHub Issues GitHub Forks GitHub Stars

A powerful and modern PHP library for performing various percentage calculations.

Report a Bug · New Pull Request

🌟 Star this Repository!

If you find the Percentage Calculator library helpful or interesting, consider giving it a star! ⭐️

Your star helps us grow and motivates us to continue improving the library. It also makes it easier for others to discover and benefit from this project.

How to Star?

  1. Login to Your GitHub Account: You need to have a GitHub account.
  2. Visit the Repository: Go to the Percentage Calculator Repository.
  3. Click the Star Button: On the top-right corner of the page, you'll find a "Star" button. Click on it!

That's it! Thank you for your support! 🚀

Table of Contents

Features

  • Calculate the percentage of a number.
  • Calculate the percentage change between two numbers.
  • Increase a number by a percentage.
  • Decrease a number by a percentage.

Installation

You can install this library via Composer. Run the following command:

composer require ramazancetinkaya/percentage-calculator

Usage

require_once 'vendor/autoload.php';

use ramazancetinkaya\PercentageCalculator;

$calculator = new PercentageCalculator();

Examples

try {
    // Calculate percentage
    $result = $calculator->calculatePercentage(250, 20);
    echo "20% of 250 is: " . $result . "\n";

    // Calculate percentage change
    $change = $calculator->calculatePercentageChange(100, 75);
    echo "Percentage change from 100 to 75 is: " . $change . "%\n";

    // Increase by percentage
    $increase = $calculator->increaseByPercentage(50, 25);
    echo "50 increased by 25% is: " . $increase . "\n";

    // Decrease by percentage
    $decrease = $calculator->decreaseByPercentage(80, 10);
    echo "80 decreased by 10% is: " . $decrease . "\n";
} catch (InvalidArgumentException $e) {
    echo "Error: " . $e->getMessage();
}

Contributing

Contributions are welcome! Please fork the repository and create a pull request.

Credits

This library was made possible by the following awesome contributors:

Special thanks to the following resources:

If you've contributed to this project and your name is not listed, please let us know, and we'll add you!

Thank you to everyone who has helped make this project better!

License

This project is licensed under the MIT License. For more details, see the LICENSE file.

percentage-calculator's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.