MCPcopy Create free account
hub / github.com/UiPath/uipathcli / formatBytes

Method formatBytes

utils/visualization/progress_bar.go:100–111  ·  view source on GitHub ↗
(count int64)

Source from the content-addressed store, hash-verified

98}
99
100func (b *ProgressBar) formatBytes(count int64) (string, string) {
101 if count < 1000 {
102 return b.formatBytesInUnit(count, "B")
103 }
104 if count < 1000*1000 {
105 return b.formatBytesInUnit(count, "kB")
106 }
107 if count < 1000*1000*1000 {
108 return b.formatBytesInUnit(count, "MB")
109 }
110 return b.formatBytesInUnit(count, "GB")
111}
112
113func (b *ProgressBar) formatBytesInUnit(count int64, unit string) (string, string) {
114 if unit == "B" {

Callers 1

renderProgressMethod · 0.95

Calls 1

formatBytesInUnitMethod · 0.95

Tested by

no test coverage detected