You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
681 B
25 lines
681 B
export function cachePage(e) { |
|
let page = {} |
|
if (JSON.parse(localStorage.getItem(e))) { |
|
page = JSON.parse(localStorage.getItem(e)) |
|
page.sum += 1 |
|
localStorage.setItem(e, JSON.stringify(page)) |
|
} else { |
|
page.name = e |
|
page.sum = 1 |
|
localStorage.setItem(e, JSON.stringify(page)) |
|
} |
|
} |
|
// 乘法计算 |
|
export function accMul(arg1, arg2) { |
|
let m = 0 |
|
let s1 = arg1.toString() |
|
let s2 = arg2.toString() |
|
try { |
|
m += s1.split('.')[1] ? s1.split('.')[1].length : '' |
|
} catch (e) {} |
|
try { |
|
m += s2.split('.')[1] ? s2.split('.')[1].length : '' |
|
} catch (e) {} |
|
return (Number(s1.replace('.', '')) * Number(s2.replace('.', ''))) / Math.pow(10, m) |
|
}
|
|
|