Commit 74bcf119 authored by Facius's avatar Facius

fix: 数字处理bug

parent 4919fa79
......@@ -330,6 +330,13 @@ export default {
if (this.checkToken()) {
this.monthRecord();
this.bookRecord();
} else {
setTimeout(()=> {
if (this.freshing) {
this.triggered = false;
this.freshing = false;
}
}, 1500)
}
},
async getWeather() {
......@@ -396,7 +403,7 @@ export default {
})
.catch(res => {});
},
bookRecord() {
bookRecord() {
bookRecord({})
.then(res => {
if (res.data) {
......
......@@ -639,11 +639,11 @@ export function formatCount(count) {
string += '00'
var num = 0
if (Number(string.substring(index + 3, index + 4) || 0) >= 5) {
num = 0.01
num = 1
}
string = string.substring(0, index + 3)
if (num > 0) {
return formatCount(Number(string) + num)
return formatCount(Math.round(Number(string) * 100 + num) / 100)
}
} else {
string += '.00'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment