heartsentwined / math
数学函数集合。
v2.0.4
2016-07-06 12:20 UTC
Requires
- php: >=5.3.3
- yalesov/arg-validator: 2.*
Requires (Dev)
This package is not auto-updated.
Last update: 2024-09-14 13:45:35 UTC
README
数学函数集合。
安装
{ "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