Skip to content

Commit

Permalink
update up down speed error
Browse files Browse the repository at this point in the history
  • Loading branch information
oguzhaninan authored Dec 9, 2016
1 parent 0c14718 commit d4c74bd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/stacer.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var downBar = new prog.Line("#down-bar", {
autoStyleContainer: false
},
step: (state, bar) => {
bar.setText(down + 'kb/s')
bar.setText(Math.abs(down).toString() + 'kb/s')
}
});

Expand All @@ -68,16 +68,16 @@ var upBar = new prog.Line("#up-bar", {
autoStyleContainer: false
},
step: (state, bar) => {
bar.setText(up + 'kb/s')
bar.setText(Math.abs(up).toString() + 'kb/s')
}
});

setInterval(() => {
si.networkStats('enp3s0', (data) => {
down = (data.rx_sec / 1024).toFixed(2)
up = (data.tx_sec / 1024).toFixed(2)
downBar.animate(down / 700)
upBar.animate(up / 700)
downBar.animate(down / 1000)
upBar.animate(up / 1000)
})
}, 1500);

Expand Down

0 comments on commit d4c74bd

Please sign in to comment.