Merge branch 'improvement/ui' into 'master'

Better display of stats

See merge request sheepitrenderfarm/client!352
This commit is contained in:
Sheepit Renderfarm
2024-12-19 12:31:41 +00:00
2 changed files with 7 additions and 5 deletions

View File

@@ -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);
}
}