提交 b07f4974 编写于 作者: 李光春's avatar 李光春

- 增加小数门面

上级 2c9e67a7
## v6.0.97 / 2020-07-23
- 增加小数门面
## v6.0.96 / 2020-07-23 ## v6.0.96 / 2020-07-23
- 网址管理增加删除协议和判断是否为Url方法 - 网址管理增加删除协议和判断是否为Url方法
......
...@@ -26,7 +26,7 @@ use think\db\exception\DbException; ...@@ -26,7 +26,7 @@ use think\db\exception\DbException;
/** /**
* 定义当前版本 * 定义当前版本
*/ */
const VERSION = '6.0.96'; const VERSION = '6.0.97';
if (!function_exists('get_ip_info')) { if (!function_exists('get_ip_info')) {
/** /**
......
<?php
// +----------------------------------------------------------------------
// | ThinkLibrary 6.0 for ThinkPhP 6.0
// +----------------------------------------------------------------------
// | 版权所有 2017~2020 [ https://www.dtapp.net ]
// +----------------------------------------------------------------------
// | 官方网站: https://gitee.com/liguangchun/ThinkLibrary
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | gitee 仓库地址 :https://gitee.com/liguangchun/ThinkLibrary
// | github 仓库地址 :https://github.com/GC0202/ThinkLibrary
// | gitlab 仓库地址 :https://gitlab.com/liguangchun/thinklibrary
// | weixin 仓库地址 :https://git.weixin.qq.com/liguangchun/ThinkLibrary
// | huaweicloud 仓库地址 :https://codehub-cn-south-1.devcloud.huaweicloud.com/composer00001/ThinkLibrary.git
// | Packagist 地址 :https://packagist.org/packages/liguangchun/think-library
// +----------------------------------------------------------------------
declare (strict_types=1);
namespace DtApp\ThinkLibrary\facade;
use DtApp\ThinkLibrary\helper\Decimals as helper;
use think\Facade;
/**
* 小数门面
* @see \DtApp\ThinkLibrary\helper\Decimals
* @package DtApp\ThinkLibrary\Decimals
* @package think\facade
* @mixin helper
*
* @method static int intval($num) 直接取整,舍弃小数保留整数
* @method static float round($num) 四舍五入取整
* @method static false|float ceil($num) 有小数,就在整数的基础上加一
* @method static false|float floor($num) 有小数,就取整数位
*/
class Decimals extends Facade
{
/**
* 获取当前Facade对应类名(或者已经绑定的容器对象标识)
* @access protected
* @return string
*/
protected static function getFacadeClass()
{
return helper::class;
}
}
...@@ -25,7 +25,7 @@ use DtApp\ThinkLibrary\helper\Ints as helper; ...@@ -25,7 +25,7 @@ use DtApp\ThinkLibrary\helper\Ints as helper;
use think\Facade; use think\Facade;
/** /**
* 数字门面 * 整数门面
* @see \DtApp\ThinkLibrary\helper\Ints * @see \DtApp\ThinkLibrary\helper\Ints
* @package DtApp\ThinkLibrary\Ints * @package DtApp\ThinkLibrary\Ints
* @package think\facade * @package think\facade
......
<?php
// +----------------------------------------------------------------------
// | ThinkLibrary 6.0 for ThinkPhP 6.0
// +----------------------------------------------------------------------
// | 版权所有 2017~2020 [ https://www.dtapp.net ]
// +----------------------------------------------------------------------
// | 官方网站: https://gitee.com/liguangchun/ThinkLibrary
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | gitee 仓库地址 :https://gitee.com/liguangchun/ThinkLibrary
// | github 仓库地址 :https://github.com/GC0202/ThinkLibrary
// | gitlab 仓库地址 :https://gitlab.com/liguangchun/thinklibrary
// | weixin 仓库地址 :https://git.weixin.qq.com/liguangchun/ThinkLibrary
// | huaweicloud 仓库地址 :https://codehub-cn-south-1.devcloud.huaweicloud.com/composer00001/ThinkLibrary.git
// | Packagist 地址 :https://packagist.org/packages/liguangchun/think-library
// +----------------------------------------------------------------------
declare (strict_types=1);
namespace DtApp\ThinkLibrary\helper;
/**
* 小数管理类
* @mixin Decimals
* @package DtApp\ThinkLibrary\helper
*/
class Decimals
{
/**
* 直接取整,舍弃小数保留整数
* @param $num
* @return int
*/
public function intval($num)
{
return intval($num);
}
/**
* 四舍五入取整
* @param $num
* @return float
*/
public function round($num)
{
return round($num);
}
/**
* 有小数,就在整数的基础上加一
* @param $num
* @return false|float
*/
public function ceil($num)
{
return ceil($num);
}
/**
* 有小数,就取整数位
* @param $num
* @return false|float
*/
public function floor($num)
{
return floor($num);
}
}
...@@ -22,7 +22,7 @@ declare (strict_types=1); ...@@ -22,7 +22,7 @@ declare (strict_types=1);
namespace DtApp\ThinkLibrary\helper; namespace DtApp\ThinkLibrary\helper;
/** /**
* 数字管理类 * 整数管理类
* @mixin Ints * @mixin Ints
* @package DtApp\ThinkLibrary\helper * @package DtApp\ThinkLibrary\helper
*/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册