Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A collection of math functions.
branch: master

tests should use strict standards

latest commit c53c72d245
heartsentwined authored
Failed to load latest commit information.
src/Heartsentwined/Math
test
.gitignore
.travis.yml dev release
README.md
composer.json

README.md

Heartsentwined\Math

Build Status

A collection of math functions.

Installation

Composer:

{
    "require": {
        "heartsentwined/math": "1.*"
    }
}

Usage

roundUp

Round a $number up to a certain $precision:

use Heartsentwined\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 Heartsentwined\Math\Math;
$dp = Math::getDecimalPlace(0.123456789); // $dp = 9
Something went wrong with that request. Please try again.