mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-07 17:36:22 +00:00
The calculate the percentage we need floating point numbers. The current code however casted the result of reclaimable/size to an int first. Casting to an int in go will just discard the decimal points, thus the result was either 0 or 1 so if multiplied by 100 it would show up as 0% or 100%. To fix this we have to multiply by 100 first before casting the result to an int. Also add a check for div by zero which results in NaN and use math.Round() to correctly round a number. Ref #13516 Signed-off-by: Paul Holzinger <pholzing@redhat.com> |
||
|---|---|---|
| .. | ||
| connection | ||
| connection.go | ||
| df.go | ||
| dial_stdio.go | ||
| events.go | ||
| info.go | ||
| migrate.go | ||
| prune.go | ||
| renumber.go | ||
| reset.go | ||
| service.go | ||
| service_abi.go | ||
| system.go | ||
| unshare.go | ||
| version.go | ||