MCPcopy Create free account
hub / github.com/FlashpointProject/FlashpointUltimateUpdater / FormatBytes

Function FormatBytes

main.go:684–698  ·  view source on GitHub ↗
(size int64)

Source from the content-addressed store, hash-verified

682}
683
684func FormatBytes(size int64) string {
685 units := []string{"B", "KB", "MB", "GB"}
686
687 var unitIndex int
688 floatSize := float64(size)
689 for unitIndex = 0; unitIndex < len(units)-1; unitIndex++ {
690 if floatSize < 1024.0 {
691 break
692 }
693 floatSize /= 1024.0
694 }
695
696 // Format with one decimal place
697 return fmt.Sprintf("%.1f%s", floatSize, units[unitIndex])
698}
699
700func loadDatabaseResume(p string, resumable bool, state *InstallerState) {
701 fmt.Printf("chosen: %v\n", p)

Callers 2

ResumeMethod · 0.85
loadDatabaseResumeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected