Store the calculated percentage as a double rather than an int, so the granular progress bar is still granular on wide displays.
This commit is contained in:
@@ -310,7 +310,7 @@ struct pvstate_s {
|
||||
|
||||
off_t prev_transferred; /* total amount transferred when called last time */
|
||||
|
||||
int percentage; /* transfer percentage completion */
|
||||
double percentage; /* transfer percentage completion */
|
||||
} calc;
|
||||
|
||||
/********************
|
||||
|
||||
+2
-2
@@ -86,11 +86,11 @@ extern unsigned int pv_getnum_count(const char *, bool);
|
||||
extern bool pv_getnum_check(const char *, pv_numtype);
|
||||
|
||||
/*
|
||||
* Return an integer representing the first amount as a percentage of the
|
||||
* Return a value representing the first amount as a percentage of the
|
||||
* second total, i.e. 100*amount/total. If the second value, the total, is
|
||||
* zero or less, return 0.
|
||||
*/
|
||||
extern int pv_percentage(off_t, const off_t);
|
||||
extern double pv_percentage(off_t, const off_t);
|
||||
|
||||
/*
|
||||
* String handling wrappers.
|
||||
|
||||
Reference in New Issue
Block a user