naive-ui.
This commit is contained in:
@@ -38,14 +38,14 @@ export function parseTime(utc: Date, format = "YYYY年M月D日") {
|
||||
return time.value
|
||||
}
|
||||
|
||||
export function submissionMemoryFormat(memory: string) {
|
||||
export function submissionMemoryFormat(memory: number | string | undefined) {
|
||||
if (memory === undefined) return "--"
|
||||
// 1048576 = 1024 * 1024
|
||||
let t = parseInt(memory) / 1048576
|
||||
let t = parseInt(memory + "") / 1048576
|
||||
return String(t.toFixed(0)) + "MB"
|
||||
}
|
||||
|
||||
export function submissionTimeFormat(time: number) {
|
||||
export function submissionTimeFormat(time: number | string | undefined) {
|
||||
if (time === undefined) return "--"
|
||||
return time + "ms"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user