|
@@ -1,8 +1,8 @@
|
|
// Parse the time to string
|
|
// Parse the time to string
|
|
-import { store } from '@/store'
|
|
|
|
import Keys from '@/constant/key'
|
|
import Keys from '@/constant/key'
|
|
-import any = jasmine.any
|
|
|
|
|
|
+import { store } from '@/store'
|
|
import Cookies from 'js-cookie'
|
|
import Cookies from 'js-cookie'
|
|
|
|
+import any = jasmine.any
|
|
|
|
|
|
export const parseTime = (
|
|
export const parseTime = (
|
|
time?: object | string | number | null,
|
|
time?: object | string | number | null,
|
|
@@ -713,6 +713,10 @@ export const fix: any = function (d: any) {
|
|
|
|
|
|
// 自定义四舍五入
|
|
// 自定义四舍五入
|
|
export const customRound = (number: number) => {
|
|
export const customRound = (number: number) => {
|
|
|
|
+ // 如果传入的是布尔值,直接返回
|
|
|
|
+ if (typeof number === 'boolean') {
|
|
|
|
+ return number;
|
|
|
|
+ }
|
|
// 确保输入在0-100范围内
|
|
// 确保输入在0-100范围内
|
|
if (number < 0) return 0;
|
|
if (number < 0) return 0;
|
|
if (number > 100) return 100;
|
|
if (number > 100) return 100;
|