Skip to content

Commit 37f7579

Browse files
committed
fix: use HumanSize for image list to avoid scientific notation The Size() method in the image formatter used HumanSizeWithPrecision with precision=3, which causes fmt %g to emit scientific notation (1e+03MB) when a size rounds to exactly 1000 in its current unit (e.g. an image of ~999.5 MB). Switch to HumanSize() which uses precision=4 (the standard across the rest of the CLI) and avoids this edge case while still producing compact human-readable output. Fixes #3091 Signed-off-by: Aaron <aaroniofjm@gmail.com>
1 parent 1d1562e commit 37f7579

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cli/command/formatter/image.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ func (c *imageContext) CreatedAt() string {
246246
}
247247

248248
func (c *imageContext) Size() string {
249-
return units.HumanSizeWithPrecision(float64(c.i.Size), 3)
249+
return units.HumanSize(float64(c.i.Size))
250250
}
251251

252252
func (c *imageContext) Containers() string {

0 commit comments

Comments
 (0)