mirror of
https://github.com/huhu/rust-search-extension
synced 2024-11-14 15:47:12 +00:00
Fix percent statistics NAN bug. fix #125
This commit is contained in:
parent
525d76d210
commit
1373987b1d
1 changed files with 1 additions and 1 deletions
|
@ -143,7 +143,7 @@ let array = Object.entries(Object.assign(defaultTypeData, stats.typeData));
|
|||
].forEach(([name, value]) => {
|
||||
let { color, description } = STATS_MAP[name];
|
||||
let li = document.createElement("li");
|
||||
let percent = (value / total * 100).toFixed(1);
|
||||
let percent = total ? (value / total * 100).toFixed(1): 0.0;
|
||||
li.innerHTML = `<div aria-label="${description}" data-balloon-pos="up" data-balloon-length="large"
|
||||
style="text-align: center" class="tooltip-color">
|
||||
<span class="color-circle-dot" style="background-color:${color}"></span>
|
||||
|
|
Loading…
Reference in a new issue