Download the PHP package ferdiunal/money without Composer

On this page you can find all versions of the php package ferdiunal/money. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package money

ferdiunal/money

Latest Version Total Downloads

This package is a fork of the sineld/money repository, with added discount and data types.

ferdiunal/money is a PHP library designed to make working with money easier! There are no static properties or methods. Any number you pass to the class will automatically be prepared for mathematical operations. The class uses , for thousands and . for decimals.

This package can be used with any framework or spaghetti application. If you encounter any issues, feel free to reach out to me by email.

Installation

Via Composer

Add the following use statement to the top of your file:

Then, start using the library!

Non-Composer Users

If you are not using Composer, simply copy the Money.php file located in the src folder to your project and begin using the library. There are no extra dependencies.

Request method aliases

Here are the parameters you can use with methods:

money->setDecimals(default = 2)
money->addTax(default = 18)
money->removeTax(default = 18)
money->setLocaleActive(default = false)
money->setLocaleCode(default = TRL)
money->setLocalePosition(default = prefix, (use "suffix" instead of reverse))

Usage Examples

In the following code example, a currency object is created using the Ferdiunal\Money\Money class. First, a currency object is created based on the specified numeric value. Then, another numeric value is added, subtracted, multiplied, and divided to the currency object. After adding a percentage-based tax, a fixed discount and a percentage-based discount are added. Finally, tax and discount are removed based on the calculations, and the currency object is formatted and retrieved using the get() method. The all() method returns the currency and tax amount as an array. The getTax() method returns the calculated tax amount. The getDiscount() method returns the calculated discount amount.

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email author email instead of using the issue tracker.

Credits

License

Please see the license file for more information.


All versions of money with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ferdiunal/money contains the following files

Loading the files please wait ....