jaycodesign/decimal

Simple wrapper around BC Math for simple math functions

Installs: 2 221

Dependents: 1

Suggesters: 0

Security: 0

Stars: 3

Watchers: 6

Forks: 1

Open Issues: 0

pkg:composer/jaycodesign/decimal

v0.2 2016-03-21 00:31 UTC

This package is not auto-updated.

Last update: 2025-09-24 19:06:43 UTC


README

Simple wrapper around BC Math for simple math functions

Installation

Simply add a dependency to your project's composer.json file if you use Composer to manage the dependencies of your project.

Here is a minimal example of a composer.json file that just defines a dependency on Decimal:

{
    "require": {
        "jaycodesign/decimal": "dev-master"
    }
}

Usage Examples

  use JaycoDesign\Decimal\Decimal;
  
  Decimal::mul(10, 5); // 50
  Decimal::div(10, 5); // 2
  Decimal::add(10, 5); // 15
  Decimal::sub(10, 5); // 5
  
  Decimal::greater_than(1,2); // TRUE
  Decimal::less_than(1,2); // FALSE
  
  Decimal::trim(10.3400000); // 10.34