MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / formatMemoryCell

Function formatMemoryCell

internal/ui/plugins/guestlist/view.go:498–507  ·  view source on GitHub ↗
(row guestRow)

Source from the content-addressed store, hash-verified

496}
497
498func formatMemoryCell(row guestRow) (string, float64) {
499 if row.memTotal <= 0 {
500 return utils.FormatBytes(row.memUsed), 0
501 }
502
503 percent := memoryRatio(row) * 100
504 text := fmt.Sprintf("%s / %s (%.0f%%)", utils.FormatBytes(row.memUsed), utils.FormatBytes(row.memTotal), percent)
505
506 return text, percent
507}
508
509func formatMemorySummary(used, total string) string {
510 if total == api.StringNA {

Callers 1

populateTableMethod · 0.85

Calls 2

FormatBytesFunction · 0.92
memoryRatioFunction · 0.85

Tested by

no test coverage detected