Download the PHP package skeeks/cms-module-money without Composer

On this page you can find all versions of the php package skeeks/cms-module-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 cms-module-money

Module for working with money and currency

Installation

The preferred way to install this extension is through composer.

Either run

or add

Configuration app

Links

Игформация о модуле

Модуль для работы с деньгами и валютой. За основу данного модуля, была взята библиотека https://github.com/sebastianbergmann/money, но ее пришлось изрядно допилить. Поэтому в чистом виде она не была подключена.

Основная работа была в том, чтобы появилась некоторая прозрачная работа с деньгами. Типичны пример, который мы прозрачно решаем в этой библиотеке. (10$ + 154руб + 12$) = рузальтат нужно показать в GBP, для de_DE локали

Сразу пример:

Установка

1) Стандартная установка через composer

or add

to the require section of your composer.json file.

2) Установка миграций

Примеры и использование

Оригинальные примеры

Creating a Money object and accessing its monetary value

The code above produces the output shown below:

100

Creating a Money object from a string value

The code above produces the output shown below:

1234

Using a Currency-specific subclass of Money

The code above produces the output shown below:

100

Please note that there is no subclass of Money that is specific to Turkish Lira as TRY is not a valid class name in PHP.

Formatting a Money object using PHP's built-in NumberFormatter

The code above produces the output shown below:

1,00 €

Basic arithmetic using Money objects

The code above produces the output shown below:

-100
300
100
200

Comparing Money objects

The code above produces the output shown below:

bool(true)
bool(false)
bool(false)
bool(true)
int(-1)
int(0)
int(1)

The compareTo() method returns an integer less than, equal to, or greater than zero if the value of one Money object is considered to be respectively less than, equal to, or greater than that of another Money object.

You can use the compareTo() method to sort an array of Money objects using PHP's built-in sorting functions:

The code above produces the output shown below:

100
200
300

Allocate the monetary value represented by a Money object among N targets

The code above produces the output shown below:

10
10
10
10
10
10
10
10
10
9

Allocate the monetary value represented by a Money object using a list of ratios

The code above produces the output shown below:

2
3

Extract a percentage (and a subtotal) from the monetary value represented by a Money object

The code above produces the output shown below:

10000 = 8265 + 1735

Please note that this extracts the percentage out of a monetary value where the percentage is already included. If you want to get the percentage of the monetary value you should use multiplication (multiply(0.21), for instance, to calculate 21% of a monetary value represented by a Money object) instead.

Страница на SkeekS CMS Marketplace

skeeks!
SkeekS CMS (Yii2) — быстро, просто, эффективно!
skeeks.com | cms.skeeks.com | marketplace.cms.skeeks.com


All versions of cms-module-money with dependencies

PHP Build Version
Package Version
No informations.
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 skeeks/cms-module-money contains the following files

Loading the files please wait ....