Login   Register  
PHP Classes
elePHPant
Icontem

PHP Price Calculator: Calculate prices using arbitrary precision math

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files Example   View files View files (19)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2014-05-24 (7 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 203 All time: 7,274 This week: 817Up
Version License PHP version Categories  
price-calculator 1.0.0BSD License5.3.0PHP 5, E-Commerce
Description Author  

This package can calculate prices using arbitrary precision math.

It can calculate the prices of goods using different strategies to compute the final price.

Currently it implements strategies to calculate the sales prices based on a value set manually, adding percentage or a fixed value over the original price.

The calculations of the prices are done using arbitrary precision math to avoid losing precision over multiple operations.

Innovation Award  
PHP Programming Innovation award nominee
June 2014
Number 6


Prize: One subscription to the PDF edition of the PHP Architect magazine
When dealing with money operations it is important to preserve the precision of the operation results as much as possible, so rounding errors do not result in serious financial losses.

This class uses arbitrary precision math to avoid rounding errors when performing operations on prices.

Manuel Lemos
Picture of Sergii Pryz
Name: Sergii Pryz <contact>
Classes: 5 packages by
Country: Ukraine Ukraine
Age: 30
All time rank: 226937 in Ukraine Ukraine
Week rank: 480 Up10 in Ukraine Ukraine Up
Innovation award
Innovation award
Nominee: 1x

  Files folder image Files  
File Role Description
Files folder imagedocs (1 directory)
Files folder imagesrc (1 file, 1 directory)
Files folder imagetests (2 files, 1 directory)
Accessible without login Plain text file CHANGELOG.md Data Documentation
Accessible without login Plain text file Example.php Example Example script
Accessible without login Plain text file LICENSE.txt Lic. Documentation
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  docs  
File Role Description
Files folder imageuml (1 file)

  Files folder image Files  /  docs  /  uml  
File Role Description
  Accessible without login Image file class.diagram.png Data Auxiliary data

  Files folder image Files  /  src  
File Role Description
Files folder imagePriceCalculator (4 files, 1 directory)
  Accessible without login Plain text file Autoload.php Aux. Class source

  Files folder image Files  /  src  /  PriceCalculator  
File Role Description
Files folder imageStrategy (2 files, 1 directory)
  Plain text file AbstractPriceCalculator.php Class Class source
  Plain text file Exception.php Class Class source
  Plain text file PriceCalculator.php Class Class source
  Plain text file PriceCalculatorInterface.php Class Class source

  Files folder image Files  /  src  /  PriceCalculator  /  Strategy  
File Role Description
Files folder imagePriceNet (3 files)
  Plain text file AbstractPriceNet.php Class Class source
  Plain text file PriceNetInterface.php Class Class source

  Files folder image Files  /  src  /  PriceCalculator  /  Strategy  /  PriceNet  
File Role Description
  Plain text file Manual.php Class Class source
  Plain text file PercentOver.php Class Class source
  Plain text file PriceOver.php Class Class source

  Files folder image Files  /  tests  
File Role Description
Files folder imagesrc (1 directory)
  Accessible without login Plain text file bootstrap.php Aux. Class source
  Accessible without login Plain text file phpunit.xml Data Auxiliary data

  Files folder image Files  /  tests  /  src  
File Role Description
Files folder imagePriceCalculator (2 files)

  Files folder image Files  /  tests  /  src  /  PriceCalculator  
File Role Description
  Accessible without login Plain text file BaseTest.php Test Class source
  Accessible without login Plain text file CalculatorTest.php Test Class source

 Version Control Unique User Downloads Download Rankings  
 100%Total:203All time:7,274
 This week:0This week:817Up