修复小数位不存在报错的情况
This commit is contained in:
parent
2c6b918020
commit
27356d1cdd
@ -86,7 +86,11 @@ function squareRoot($number)
|
||||
function getDecimalPlaces($number)
|
||||
{
|
||||
$temp = explode('.', $number);
|
||||
return strlen($temp[1]);
|
||||
if (isset($temp[1])) {
|
||||
return strlen($temp[1]);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 测试二分查找给定值
|
||||
|
Loading…
Reference in New Issue
Block a user