Skip to content

格式化文件大小 ​

方法名 ​

formatFileSize

用法 ​

用法示例 ​

js
module.formatFileSize({
  size: 3456789,
}, res => {
  console.log(res)
})

参数说明 ​

参数名参数类型是否必填默认值参数描述
sizeInteger否无字节数

回调 ​

回调示例 ​

json
{
    "data": {
        "sizeFormat": "3.30M"
    },
    "message": "",
    "code": 0
}

回调说明 ​

参数名参数类型参数描述
messageString消息提示
dataObject数据对象
data.sizeFormatString格式化数据
codeInteger返回类型,0.成功,其他:失败