fix percentage calculation.

This commit is contained in:
Christopher Jeffrey 2014-10-30 15:36:05 -07:00
parent 997d01ffa4
commit 8e05e1aa3c
1 changed files with 2 additions and 1 deletions

View File

@ -1579,7 +1579,8 @@ async_get_progress_after(uv_work_t *req) {
unsigned int hours_behind = left / 60 / 60;
unsigned int days_behind = left / 60 / 60 / 24;
unsigned int percent = 100 - (left / now * 100);
double cur = (double)left / (double)now;
unsigned int percent = (unsigned int)(cur * 100.0);
Local<Object> result = NanNew<Object>();