PHP Classes

Profit and Loss PHP Calculator: Math class that can calculate profit and loss

Recommend this page to a friend!
  Info   View files Example   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog (1)    
Last Updated Ratings Unique User Downloads Download Rankings
2023-01-27 (8 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 61 All time: 10,332 This week: 204Up
Version License PHP version Categories
profitandlosscalcula 1.0Free For Educatio...5PHP 5, Finances, Math, Global


This package provides a simple math class that can calculate profit and loss.

It provides a class that can perform addition and subtraction of amount values.

The package comes with an example script that presents a form for the user to enter the cost price and selling prices, and then it tells the user if there was a profit or loss.

Another example script can calculate the cost prices if it is missing from the selling price and the profit and loss percentages or can calculate the selling price if it is missing from the cost prices and the profit and loss percentages.

Innovation Award
PHP Programming Innovation award nominee
January 2023
Number 9
Finance is essential to measure the success or failure of a business in terms of whether it is earning or losing money.

The package can help calculate the cost and selling prices of products or services for profit or loss percentages.

Manuel Lemos
Picture of Dev Sharma
  Performance   Level  
Name: Dev Sharma <contact>
Classes: 4 packages by
Country: India India
Age: 20
All time rank: 3205209 in India India
Week rank: 411 Up36 in India India Up
Innovation award
Innovation award
Nominee: 2x



Profit and Loss calculator is a simple calculator which helps you find the profit or loss using the cost price and the selling price with percentage which rounds up-to 2 decimal places if needed. The calculator only follows the formula it is meant to follow in the profit and loss formulas.


The advanced version helps you to find out the cost price or selling price(if it's missing from your problem sum) with the help of profit or your loss given below in your problem sum.


  Files folder image Files  
File Role Description
Accessible without login Plain text file AdvancedPnL.php Aux. Auxiliary script
Plain text file class.calc.php Class Class source
Accessible without login Plain text file PnL.php Example Example script
Accessible without login Plain text file Doc. Documentation

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:10,332
This week:204Up