数学函数集合。

v2.0.4 2016-07-06 12:20 UTC

This package is not auto-updated.

Last update: 2024-09-14 13:45:35 UTC


README

Build Status

数学函数集合。

安装

Composer:

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

用法

roundUp

$number 四舍五入到特定的 $precision

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

$number: 任何数值标量 $precision: 遵循 PHP 的 round 函数,即。

  • 2 = 两位小数
  • -2 = 最接近的百位数

getDecimalPlace

获取小数位数

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