MCPcopy Create free account
hub / github.com/FloatTech/ZeroBot-Plugin / storagefmt

Function storagefmt

plugin/aifalse/main.go:641–655  ·  view source on GitHub ↗
(num float64)

Source from the content-addressed store, hash-verified

639}
640
641func storagefmt(num float64) string {
642 if num /= 1024; num < 1 {
643 return strconv.FormatFloat(num*1024, 'f', 2, 64) + "B"
644 }
645 if num /= 1024; num < 1 {
646 return strconv.FormatFloat(num*1024, 'f', 2, 64) + "KB"
647 }
648 if num /= 1024; num < 1 {
649 return strconv.FormatFloat(num*1024, 'f', 2, 64) + "MB"
650 }
651 if num /= 1024; num < 1 {
652 return strconv.FormatFloat(num*1024, 'f', 2, 64) + "GB"
653 }
654 return strconv.FormatFloat(num, 'f', 2, 64) + "TB"
655}
656
657func diskstate() (stateinfo []*status, err error) {
658 parts, err := disk.Partitions(false)

Callers 3

basicstateFunction · 0.85
diskstateFunction · 0.85
moreinfoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected