Better display of stats
This commit is contained in:
@@ -24,14 +24,14 @@ public class TransferStats {
|
||||
}
|
||||
|
||||
public String getSessionTraffic() {
|
||||
return Utils.formatDataConsumption(this.bytes);
|
||||
return Utils.formatDataConsumption(this.bytes, 0);
|
||||
}
|
||||
|
||||
public String getAverageSessionSpeed() {
|
||||
try {
|
||||
return Utils.formatDataConsumption((long) (this.bytes / (this.millis / 1000f)));
|
||||
return Utils.formatDataConsumption((long) (this.bytes / (this.millis / 1000f)), 1);
|
||||
} catch (ArithmeticException e) { // Unlikely, but potential division by zero fallback if first transfer is done in zero millis
|
||||
return Utils.formatDataConsumption((long) (this.bytes / (0.1f)));
|
||||
return Utils.formatDataConsumption((long) (this.bytes / (0.1f)), 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user