Commit b5c8c9dd authored by therealwolf's avatar therealwolf 💯
Browse files

fix

parent fac733e7
......@@ -46,11 +46,13 @@ export let get_change = (x: {}) => {
let before = x[`before_${d}`] || 0;
let change = 0;
//x[`change_${d}`] = `${((x[d] / x[`before_${d}`] - 1) * 100).toFixed(2)}%`
if (before === 0 || isNaN(before)) {
change = parseFloat(current.toFixed(3));
} else {
change = parseFloat((current / before).toFixed(3));
if (current) {
//x[`change_${d}`] = `${((x[d] / x[`before_${d}`] - 1) * 100).toFixed(2)}%`
if (before === 0 || isNaN(before)) {
change = parseFloat(current.toFixed(3));
} else {
change = parseFloat((current / before).toFixed(3));
}
}
x[`change_${d}`] = isNaN(change) ? 0 : change;
}
......
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