更新音源API (#1352)
* 更新API --------- Co-authored-by: lyswhut <lyswhut@qq.com>
This commit is contained in:
@@ -5,6 +5,17 @@ export * from '@common/utils/nodejs'
|
||||
export * from '@common/utils/common'
|
||||
export * from '@common/utils/tools'
|
||||
|
||||
/**
|
||||
* 格式化播放数量
|
||||
* @param {*} num 数字
|
||||
*/
|
||||
export const formatPlayCount = (num: number): string => {
|
||||
if (num > 100000000) return `${Math.trunc(num / 10000000) / 10}亿`
|
||||
if (num > 10000) return `${Math.trunc(num / 1000) / 10}万`
|
||||
return String(num)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 时间格式化
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user