A collection of math functions.
PHP
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/Yalesov/Math
test
.gitignore
.travis.yml
README.md
composer.json

README.md

Yalesov\Math

Build Status

A collection of math functions.

Installation

Composer:

{
  "require": {
    "yalesov/math": "2.*"
  }
}

Usage

roundUp

Round a $number up to a certain $precision:

use Yalesov\Math\Math;
Math::roundUp($number, $precision);

$number: any numeric scalar $precision: follows PHP's round function, i.e.

  • 2 = two decimal places
  • -2 = neartest hundreds

getDecimalPlace

Get the number of decimal places:

use Yalesov\Math\Math;
$dp = Math::getDecimalPlace(0.123456789); // $dp = 9